I'm using python, and I'm not sure how to print this Your total is 22 out of 30, or 73.33%. Also, how can i use the for loop on this- Write an algorithm that calculates the total grade for N classroom exercises as a percentage. The user should input the value for N followed by each of the N scores and totals.  Calcuate the overall percentage (sum of the total points earned divided by the total points possible) and output it as a percentage.  Sample input and output is shown below: How many exercises to input? 3 Score received for exercise 1: 10 Total points possible for exercise 1: 10 Score received for exercise 2: 7 Total points possible for exercise 2: 12 Score received for exercise 3: 5 Total points possible for exercise 3: 8 Your total is 22 out of 30, or 73.33% This is what I have: possScores = 0 sumOfScores = 0 totalScores = 0 numOfExer = int(input("How many exercises to input? ")) # Taking number 1 from user as int exer1 = int(input("Score received for exercise 1: ")) possScores1 = int(input("Total points possible for exercise 1: "))   # Taking number 2 from user as int exer2 = int(input("Score received for exercise 2: ")) possScores2 = int(input("Total points possible for exercise 2: ")) # Taking number 3 from user as int exer3 = int(input("Score received for exercise 3: ")) possScores3 = int(input("Total points possible for exercise 3: "))   # adding num1 and num2 and storing them in # variable addition sumOfScores = exer1 + exer2 + exer3 possScores = possScores1 +  possScores2 + possScores3 totalScores = sumOfScores/possScores   # printing print("Your total is ", sumOfScores,"out of ",possScores, "or ")

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I'm using python, and I'm not sure how to print this Your total is 22 out of 30, or 73.33%Also, how can i use the for loop on this-

  1. Write an algorithm that calculates the total grade for N classroom exercises as a percentage. The user should input the value for N followed by each of the N scores and totals.  Calcuate the overall percentage (sum of the total points earned divided by the total points possible) and output it as a percentage.  Sample input and output is shown below:

How many exercises to input? 3

Score received for exercise 1: 10

Total points possible for exercise 1: 10

Score received for exercise 2: 7

Total points possible for exercise 2: 12

Score received for exercise 3: 5

Total points possible for exercise 3: 8

Your total is 22 out of 30, or 73.33%

This is what I have:

possScores = 0
sumOfScores = 0
totalScores = 0


numOfExer = int(input("How many exercises to input? "))

# Taking number 1 from user as int
exer1 = int(input("Score received for exercise 1: "))

possScores1 = int(input("Total points possible for exercise 1: "))
 
# Taking number 2 from user as int
exer2 = int(input("Score received for exercise 2: "))

possScores2 = int(input("Total points possible for exercise 2: "))
# Taking number 3 from user as int
exer3 = int(input("Score received for exercise 3: "))

possScores3 = int(input("Total points possible for exercise 3: "))
 
# adding num1 and num2 and storing them in
# variable addition
sumOfScores = exer1 + exer2 + exer3
possScores = possScores1 +  possScores2 + possScores3
totalScores = sumOfScores/possScores
 
# printing
print("Your total is ", sumOfScores,"out of ",possScores, "or ")

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Basics of loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education