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
write a java program using a do while loop to prompt the user to enter a password. The user should be prompted to enter the pass
Alex787 [66]
We can import Scanner from Java.utils.Scanner to pull in text entered in the console.

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String password = "";
do {
System.out.print("Enter your password: ");
password = sc.nextLine();
if(!password.equals("pals") {
System.out.println(\nIncorrect Password. Try again.");
}
} while(!password.equals("pals");
3 0
3 years ago
Write a program that asks the user to enter a birth year. the program should then indicate which generation a person of that yea
USPshnik [31]
Something like the following. Also you need to give what language you are using. Anyways, you should be able to convert this to your language of choice. 

<script type="text/javascript">
function checkGeneration() { 
   var gen = ["Baby Boomer ","Generation X","Xennials","Generation Y"];
   var reversestr = "";
   var getyear = window.prompt("Enter a 3 digit number: ");
    if (parseInt(getyear) <= 1964) {
        alert(gen[0]);   
    } else if(parseInt(getyear) <= 1979) {
        alert(gen[1]);
    } else if(parseInt(getyear) <= 1985) {
        alert(gen[2]);               
   }  else if(parseInt(getyear) <= 1995) {
        alert(gen[3]);
   }
 }
checkGeneration();
</script>
7 0
3 years ago
How to write cube of a number from flowchart ​
AlekseyPX

Answer:

This is the process to write flowchart .

Help it is helpful.

4 0
3 years ago
Which of the following best describes the purpose of child labor laws?
BabaBlast [244]

Answer:

Are there supposed to be answer choices with this question?

Child labor laws are basically laws placing restrictions and regulations on the work of minors.

6 0
3 years ago
Read 2 more answers
What type of network is the internet
shtirl [24]

Answer:

The internet is considered as Wide Area Network (WAN).

5 0
3 years ago
Other questions:
  • Write a Python function merge_dict that takes two dictionaries(d1, d2) as parameters, and returns a modified dictionary(d1) cons
    5·1 answer
  • What are the advantages of businesses using Twitter ?
    12·1 answer
  • How many hosts are in each subnet?
    15·1 answer
  • Describe the positive and negative effects of Internet​
    6·2 answers
  • A(n) ________ software installation copies all the most commonly used files to your computer's hard drive.
    10·1 answer
  • Radio waves can be used to transmit energy. What is an advantage of this method in computer technology
    7·2 answers
  • EASY What does the Backspace key do?
    6·1 answer
  • What is the best resource to learn python?
    14·2 answers
  • Porque es importante la tecnología?​
    8·1 answer
  • Can someone reply me
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!