subject

Address the fixme comments. move the respective code from the while-loop to the created function. the add_grade function has already been created.# fixme: create add_grade functiondef add_grade(student_grades): print('entering grade. \n')name, grade = input(grade_prompt).split()student_ grades[name] = grade# fixme: create delete_name function# fixme: create print_grades functionstudent_grades = {} # create an empty dictgrade_prompt = "enter name and grade (ex. 'bob a+'): \n"delete_prompt = "enter name to delete: \n"menu_prompt = ("1. add/modify student grade\n""2. delete student grade\n""3. print student grades\n""4. quit\n\n")command = input(menu_prompt).()while command ! = '4': # exit when user enters '4'if command == '1': add_grade(student_grades)elif command == '2': # fixme: only call delete_name() hereprint('deleting grade.\n')name = input(delete_prompt)del student_grades[name]elif command == '3': # fixme: only call print_grades() hereprint('printing grades.\n') for name, grade in student_grades. items(): print(name, 'has a', grade) else: print('unrecognized command.\n') command = ()

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:30
4.11 painting a wall (1) prompt the user to input integers for a wall's height and width. calculate and output the wall's area (integer). note that in this case there is a new line after each prompt. (submit for 1 point). enter wall height (feet): 11 enter wall width (feet): 15 wall area: 165 square feet (2) extend to also calculate and output the amount of paint in gallons needed to paint the wall (floating point). assume a gallon of paint covers 350 square feet. store this value in a variable. output the amount of paint needed using the %f conversion specifier. (submit for 2 points, so 3 points total). enter wall height (feet): 11 enter wall width (feet): 15 wall area: 165 square feet paint needed: 0.471429 gallons (3) extend to also calculate and output the number of 1 gallon cans needed to paint the wall. hint: use a math function to round up to the nearest gallon. (submit for 2 points, so 5 points total). enter wall height (feet): 11 enter wall width (feet): 15 wall area: 165 square feet paint needed: 0.471429 gallons
Answers: 3
question
Computers and Technology, 22.06.2019 08:10
Technician a says that if a valve is open when a piston rises to the very top of a cylinder, the piston may actually strike the valve head and cause serious engine damage. technician b says if the camshaft is located in the engine block, then the engine is called an overhead valve engine, ohv engine, or an in-block camshaft. who is right? a. b only b. both a and b c. a only d. neither a nor b
Answers: 3
question
Computers and Technology, 22.06.2019 11:10
Which are not examples of chronic or persistent stress? moving
Answers: 1
question
Computers and Technology, 23.06.2019 03:10
Fill in the following program so that it will correctly calculate the price of the orange juice the user is buying based on the buy one get one sale.#include //main functionint main() { int cartons; float price, total; //prompt user for input information printf("what is the cost of one container of oj in dollars? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & price); printf("how many containers are you buying? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & cartons); if ( [ select ] ["cartons / 2", "cartons % 1", "cartons % 2", "cartons % price", "cartons / price", "cartons / total"] [ select ] ["=", "==", "! =", "< =", "> =", "< "] 0) total = [ select ] ["price * cartons", "cartons * price / 2 + price", "(cartons / 2) * price", "cartons / (2.0 * price)", "(cartons / 2.0) * price + price", "((cartons / 2) * price) + price"] ; else total = ((cartons / 2) * price) + price; printf("the total cost is $%.2f.\n", total); return 0; }
Answers: 2
You know the right answer?
Address the fixme comments. move the respective code from the while-loop to the created function. th...
Questions
question
History, 20.08.2021 21:40
question
Mathematics, 20.08.2021 21:40
question
Mathematics, 20.08.2021 21:40