Advertisement
ONGER

Joe’s Pizza Palace And Final Grade

Apr 25th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. SOLUTION LINK: https://www.ankitcodinghub.com/product/joes-pizza-palace-and-final-grade/?v=518f4a738816
  2.  
  3. Joe’s Pizza Palace needs a program to calculate the number of slices a pizza of any size can be divided into. The program should perform the following steps:
  4.  
  5. A) Ask the user for the diameter of the pizza in inches.
  6.  
  7. B) Calculate the number of slices that may be taken from a pizza of that size.
  8.  
  9. C) Display a message telling the number of slices.
  10.  
  11. To calculate the number of slices that may be taken from the pizza, you must know the following facts:
  12.  
  13. • Each slice should have an area of 14.125 inches.
  14.  
  15. • To calculate the number of slices, simply divide the area of the pizza by 14.125.
  16.  
  17. • The area of the pizza is calculated with this formula: Area = π*r2
  18.  
  19. Question 2:
  20.  
  21. Python program that calculates a student Final grade for a class that has two assignments and two exams. Assignments worth 40% of the class grade and exams worth 60% of the class grade. The program should perform the following steps:
  22.  
  23. A) Ask the user for assignment1, assignment2, exam1, and exam2 grades. all grades are out of 100 .
  24.  
  25. B) Calculate the average of the assignments.
  26.  
  27. C) Calculate the average of the exams.
  28.  
  29. D) Calculate the final grade using the following formula:
  30.  
  31. final grade=.4*average of the assignments+.6*average of the exams.
  32.  
  33. E) Format the final grade to have 2 decimal places.
  34.  
  35. F) Display a message telling the student what the final grade is.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement