Professional Documents
Culture Documents
Varun Manjunatha - Unit 2 Help A Business - 6596503
Varun Manjunatha - Unit 2 Help A Business - 6596503
Task Details:
Team Details:
Varun: program
Leelesh: company details
Nishika: company details
is_finish = 'a'
price = 1
ac = 0
is_returning = 'a'
amount=1
print('Hello welcome to EasyBuy')
print()
print('apple 1kg - ₹40')
print('carrot 1/2kg - ₹16')
print('potato 1kg - ₹50')
print('milk 1l - ₹26')
print('cheese - ₹15')
print('watermellon 3kg- ₹128')
print('oreo - ₹10')
print('dairymilk - ₹25')
print()
while is_finish != 'yes':
product = input('which of these items do you wish to purchase:')
if product not in 'applecarrotpotatomilkcheesewatermellonoreodairymilk':
print('we do not sell this product')
continue
amount = int(input('how much of this product do you wish to buy'))
if product == 'apple':
price = amount * 40
elif product == 'carrot':
price = amount * 16
elif product == 'potato':
price = amount * 50
elif product == 'milk':
price = amount * 26
elif product == 'cheese':
price = amount * 15
elif product == 'watermellon':
price = amount * 128
elif product == 'oreo':
price = amount * 10
elif product == 'dairymilk':
price = amount * 25
is_finish = input('Are these all the items that need to be purchased (yes,no)')
ac = ac + price
print()
print(ac,'is the total price')
print()
is_finish = 'no'
is_returning=input('do you wish to return any items?(yes/no):')
while is_returning != 'yes' and is_returning != 'no':
print('invalid input')
is_returning=input('do you wish to return any items?(yes/no):')
while is_returning == 'yes' and is_finish == 'no':
product = input('which of these items do you wish to return:')
if product not in 'applecarrotpotatomilkcheesewatermellonoreodairymilk':
print('we do not sell this product')
EKYA SCHOOLS / CMR NATIONAL PUBLIC SCHOOL
SUBJECT: COMPUTER SCIENCE
GRADE: VII
continue
amount2 = int(input('how much of this product do you wish to return'))
if amount2 > amount:
print('You have not purchased this quantity of this item and hence cannot return it')
continue
elif product == 'apple':
ac = ac - 40 * amount2
elif product == 'carrot':
ac = ac - 16 * amount2
elif product == 'potato':
ac = ac - 50 * amount2
elif product == 'milk':
ac = ac - 26 * amount2
elif product == 'cheese':
ac = ac - 15 * amount2
elif product == 'watermellon':
ac = ac - 128 * amount2
elif product == 'oreo':
ac = ac - 10 * amount2
elif product == 'dairymilk':
ac = ac - 25 * amount2
is_finish = input('are these all the items you wish to return?(yes/no):')
print()
print(ac, 'is the final price')
print()
print('Thankyou for shoping with us')
1. What are the errors that you encountered and how did you fix these errors?
2. Does the program work for different kinds of input from the user? Mention the inputs that you tested
the program with and sample output that you saw.