Coding | Mcqs | Multiple choice questions | Informative | Computer Science | Engineering | Aptitude | Quants | Verbal

INFEED

27/03 infytq screening test programs

 1 . Problem Statement: Your old mobile phone gets broken and so you want to purchase a new smartphone and decide to go through all the online websites to �nd out which dealer has the best offer for a particular model. You document the prices of N dealers. Dealer ids start from 0 and go up to N. Find out which dealer has the best price for you. Constraints: 1 <= N <= 100 1 <= A[] <= 100000 Input Description: Number of dealers followed by the price offered by each dealer Output Description: Dealer offering the best price

 

 

 

a=int(input()) 

b=list(map(int,input().split()))

 print("dealer",end="") 

print(b.index(min(b))) 




PYTHON 

 

 

2.  Problem Statement: Vasanth is working at company XYZ. He has been taking leave often in the past couple of weeks and his manager, who also happens to be his friend, is worried that Vasanth might be exceeding his number of paid holidays, which might be a black mark in Vasanth monthly report. The manager analysis Vasanth’s attendance register and decides to warn him beforehand. The attendance register has a ‘P’ marked for present and an ‘A’ marked for absent. Vasanth will be blacklisted if his attendance falls below 25%. Your task is to help the manager �nd out whether Vasanth could be blacklisted or not. Input Description: First line contains the number of entries in the attendance register, followed by space separated values of attendance (‘P’ or ‘A’) Output Description: ‘Blacklisted’ if attendance is below 25% ‘Not Blacklisted’ if attendance is above 25%

 

PROGRAM :

 

a=int(input())

b=input().split()

c=0

for i in  b:

    if(i=='P'):

        c+=1

y=(c/a)*100

if(y<25):

    print("Blacklisted")

elif(y>=25):

    print("Not Blacklisted")

 

python 





Post a Comment

Previous Post Next Post