Answered step by step
Verified Expert Solution
Question
1 Approved Answer
hello, please read the directions and help. BELOW HERE IS THE TEMPLATE TO ADD CODES INTO IDLE. Program: final.py Specification First, download the template file,
hello, please read the directions and help.
BELOW HERE IS THE TEMPLATE TO ADD CODES INTO IDLE.
Program: final.py Specification First, download the template file, final.py . This file contains the function names and documentation. You are required to add a header comment block with your name, the file name, the current semester, and year. Do not change the function headers, just add your implementation for each function where indicated. Add descriptive comments to your code. Remember to indent all the code for the function. Submit your completed file to Gradescope. The auto grader grade you will receive right away. I'll be manually grading your code for clarity and documentation after the due date. Here are the functions that you will write: Calculating tips is a common operation and the first function you write for the final project will do exactly that. The function calculate_tip accepts two parameters, the bill amount and the percent to tip, and returns the amount of the tip to write into the bill. The function should return the string "Invalid charge amount" if the charge is not more that 0 and "Invalid tip percent" if the tip is less than 0. Function heading: def calculate_tip(charge, tip_percent): Parameter Specification: charge is the total charge and tip_percent is the % of total Return Value Specification: the amount to tip based on the charge and percent given Sample Function Call: calculate_tip(27.5, 20) Sample Return Value: 5.5 Sample Function Call: calculate_tip(-1.0, 15) Sample Return Value: Invalid charge amount Sample Function Call: calculate_tip(27.5, -1) Sample Return Value: Invalid tip percent The VCU bulletin (http://bulletin.vcu.edu/academic-regs/ugrad/classification/) lists the number of credits needed for the four undergraduate classifications. The function classify_student has an integer as a parameter and returns the string that represents the year according to this table: Year Freshmen one to 23 credit hours Credits Sophomores24 to 53 credit hours Juniors Seniors 54 to 84 credit hours 85 credit hours and more
Step by Step Solution
There are 3 Steps involved in it
Step: 1
File finalpy Author Your Name Semester Current Semester Year Current Year def calculatetipcharg...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started