1.Write a program, to print the following on the screen:
What percent are you aiming for in this Python module?
and then read in an answer string on the next line. It must then calculate what exam percent is required to reach this target if the user gets 90% for the Python assignments. The final mark target is calculated as 0.7*examPercent + 0.3*assignmentPercent (see Course Outline). Your last output line must be:
If you get 90% for the assignments then you will need <whatever>% for the exam
2.Write a program, that extends question 2.py to handle the requirement that the exam percent in a module must be a minimum of 40%, otherwise the module is failed.
1
Expert's answer
2015-03-18T14:09:13-0400
'''Written for Python 2.7.2.''' print 'What percent are you aiming for in this Python module?' while True: try: target = int(raw_input('')) except: continue if (target >= 0) and (target <= 100): break else: print 'Enter correct percentage!' continue exam = int((target - 0.3*90)/0.7) print 'If you get 90% for the assignments then you will need {0}% for the exam'.format(exam)
=================================================================================== '''Written for Python 2.7.2.''' print 'What percent are you aiming for in this Python module?' while True: try: target = int(raw_input('')) except: continue if (target >= 0) and (target <= 100): exam = int((target - 0.3*90)/0.7) if exam <40: print 'You will receive only {0}% for exam. Try harder otherwise you will fail the module.'.format(exam) continue else: print 'If you get 90% for the assignments then you will need {0}% for the exam'.format(exam) break else: print 'Enter correct percentage!' continue
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment