1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vinil7 [7]
3 years ago
11

write a program that calculates the total grade for N classroom exerices as a perfentage. the user should input the value for N

followed by each of the N scores and totals.
Computers and Technology
1 answer:
miskamm [114]3 years ago
7 0

Answer:

earned = 0

total = 0

exercises = int(input("Enter the number of exercises: "))

for i in range(exercises):

   score = int(input("Enter score" + str(i+1) + ": "))

   total_score = int(input("Enter total score for exercise " + str(i+1) + ": "))

   

   earned += score

   total += total_score

print("The total is %" + str(earned/total * 100))

Explanation:

*The code is in Python.

Set the earned and total as 0

Ask the user to enter the number of exercises

Create a for loop that iterates number of exercises times. For each exercise;

Ask the user to enter the score earned and total score of that exercise

Add the score to the earned (cumulative sum)

Add the total_score to the total (cumulative sum)

When the loop is done, calculate the percentage, divide earned by the total and multiply the result by 100, and print it

You might be interested in
Define operating system?explain the types of operating system on the basis of use.​
GalinKa [24]

Answer:

An operating system is a software that helps the any computers basic needs or functions.  For example, the windows on a computer is a operating system.

Explanation:

4 0
2 years ago
Which option identifies what the computer will yield in the following scenario?
dolphi86 [110]
I think it would be the computer program will create a design with the exact dimensions
6 0
2 years ago
Def sum_divisors(n): sum =1 # Return the sum of all divisors of n, not including n x=int(n**0.5) for i in range(2,(x//1)+1): if
Novosadov [1.4K]

Answer:

This is a python program that counts the number of divisors of a given number and calculates the sum of the divisors.

Explanation:

The first line defines a function "sum_divisors" with an argument "n". The square root of the argument is converted to integer and assigned to the variable "x", then a for loop is used to iterate through the range 2 to the calculated nth number of divisors in the argument.The return keyword returns the sum value.

The function is called with several arguments and printed with the print function.

6 0
3 years ago
NumA=2<br> for count range (5,8)<br> numA=numA+count <br> print(numA)
love history [14]

Answer:

for count in range (5,8): numA=numA+count print(numA)

Explanation:

7 0
3 years ago
Identify the type of error.<br> print "hello"<br><br> num = 5 / 0
horrorfan [7]

Answer:

Syntax error

Explanation:

This is a type of error that occurs when there is a problem with the code that makes it unable to compile and execute.

For example, making a conditional statement without using the correct parameters will result in a syntax error.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Mike is reading about machine-dependent programming languages. Which languages are machine-dependent programming languages?
    11·1 answer
  • ________ is an open-source program supported by the Apache Foundation that manages thousands of computers and implements MapRedu
    5·1 answer
  • These are questions from my Computer/Customer Support Class
    6·1 answer
  • Describe three main types of testing and the order in which they are performed.
    9·2 answers
  • How can a network design project benefit from the principles of itsm? How might itsm impede a network design project?
    11·1 answer
  • The main advantage of a solid state drive is:
    5·1 answer
  • Choose the best technology device for the
    12·1 answer
  • Write a program that prompts the user to enter two characters and display the corresponding major and year status. The first cha
    15·1 answer
  • Assume the availability of a function is_prime. Assume a variable n has been associated with positive integer. Write the stateme
    15·1 answer
  • (14) Click on the
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!