Sie sind auf Seite 1von 3

NAME: RAJAT MAHESHWARI

REGISTRATION NUMBER: 16BCE1001


Topic: Question for virtual lab

Question1: The details of all employees (ID no, name, mobile number) of a company XYZ is
stored and maintained by the companys IT department. On his birthday, the chairman
wants to surprise a few of his employees whose ID number is divisible by 3 and is not
divisible by 4, by giving Rs.5000. He instructs the ID department to display the mobile
number along with the name of all employees who are eligible for gift. (An employee is
eligible for gift). Write a program to automate the selection and intimation.

PAC chart:

Input Processing involved Output Solution alternatives


Read ID no.,name and Gift of Rs.5000=ID no. Who all are eligible for ID number should have
mobile number of %3=0 and ID no.%4! gift constant digits and
employees of a =0 positive integers
company XYZ Mobile number shoul
be constants and
positive integers

Flowchart:
Pseudocode:

Read Id no., name and mobile number of employees of a company of XYZ


Gift of Rs.5000=Id no.%3= and ID no.%4!=0
Find out who all are eligible for gift

Programming:

n=int(input('Enter the ID no. of employee:'))


s=input('Enter the name of the employee:')
t=int(input('Enter the mobile no. of the employee:'))
if(n%3==0 and n%4!=0):
print('Emoloyee is eligible for gift of Rs.5000')
else:
print('Employee is not eligible for gift')

Output Screenshot:
Question2: Adhitya has got lot of friends all around the world. All of them have the interesting
habit of sending letters to each other to express their feelings. Adhitya has the practice
of keeping all the stamps pasted on the letters safely. On every New Year day, he
arranges all the stamps of preceding year according to the month of arrival, puts it on a
small cover (stamps of four months are put in same cover) and indexes it with
numbers. For example, 1 to represent January to April, 2 to represent May to august
etc,. Along with the index, the number of stamps for those months is also stored. He
then puts everything in a big cover and labels it with year number. At the age of 35, he has got
around 3 such covers labeled with years of arrival. Adhityas cute son wants to
see how many stamps he has collected in August 2007. Help him to find out by writing
a procedure. (Assume that thecovers are not in sequence).

PAC chart:

Input Processing involved Output Solution alternatives


Read input for all Create a 2 dimensional Print how many stamps Assume Adhitya age
months ,years from array which stores all his son has collected in should be greater than
2007 to 2009 the no. of letters August,2007 using or equal to 32
collected from various array Assume present year
months. when he is 35 years
old is 2009

Question3: ICICI bank assigns payback points to customer for every purchase they do using debit
card. The customers are given the option to redeem the points in an online shopping portal
X.com. The website maintains a list containing the items, the quantity available and points
required to purchase that item. Write procedure and draw the flowchart to display the item the
customer will get by redemption along with the remaining points, if any. Print Earn more points,
if the entered payback point is less than the minimum points for redemption. Print, Kindly excuse,
if the quantity of the required item is not available.

PAC chart:

Input Processing Output Solution alternatives


Input pay back points Check whether back Print Earn more Quantity of item
as a points are above the points, if the entered should be positive
Input quantity of item limit or check whether payback point is less integers
as b quantity of item is less than the minimum
than limit points for redemption.
Print, Kindly excuse,
if the quantity of the
required item is not
available.

Das könnte Ihnen auch gefallen