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
antiseptic1488 [7]
3 years ago
8

You want to know your grade in Computer Science, so write a program that continuously takes grades between 0 and 100 to standard

input until you input "stop", at which point it should print your average to standard output.
Computers and Technology
1 answer:
Dominik [7]3 years ago
6 0

Answer:

Following are the program in the Python Programming Language.

#declare variables and initialize to 0

s=0

n=0

avg=0

#set the infinite while loop  

while(True):

 #get input from the user

 score=input()

 #set if statement to break loop

 if(score =="stop"):

   break

 #otherwise, perform calculation

 else:  

   n+= 1

   s=s+ int(score)

   avg= s/n

#print average of the input

print ('average: ',avg)

<u>Output</u>:

58

96

34

15

stop

average:  50.75

Explanation:

<u>Following are the description of the program</u>.

  • Firstly, set three variable that is 's' for sum, 'n' for count and 'avg' for average and initialize them to 0.
  • Set the infinite while loop and inside it, set variable 'score' that get input from the user then, set the if conditional statement for break the loop, otherwise we calculate the sum of the user input and calculate its average.
  • Finally, we print the result with message.
You might be interested in
Assume that you are testing the Orders database introduced in Watt (2014) - Appendix C. Discuss the problems and possible conseq
madreJ [45]

Answer:

129 \frac{2}{?} 23.4. \div 164 \times 5y1 + . \\ .00487ggh

6 0
3 years ago
What is the inverse function of d(x ) = -2x - 6?
PtichkaEL [24]

Answer:

-\frac{x}{2} - 3

Explanation:

d(x) = -2x - 6

to find the inverse of a function, you need to follow these steps:

1. set d(x) = y

2. interchange the variables, so y becomes x and x becomes y

3. solve the equation for y

<u>step 1:</u> set d(x) = y

y = -2x -6

<u>step 2:</u> interchanging the variables

y = -2x - 6 turns into x = -2y - 6

<u>step 3:</u> solving for y

x = -2y - 6 < add 6 to both sides to get rid of it on the right

x + 6 = -2y < divide both sides by -2 to get y alone

x + 6 / -2 = -\frac{x}{2} - 3

-2y / -2 = y

-\frac{x}{2} - 3 = y

so the inverse of the function is -\frac{x}{2} - 3

7 0
3 years ago
The ____ tool allows a user to connect to the active registry database and make changes that are effective immediately. editreg.
kenny6666 [7]
Regedit is the Answer
3 0
3 years ago
Maia is typing her report on meerkats for her biology class.
dem82 [27]

Answer:

         

Explanation:

4 0
2 years ago
Which type of connection is needed to synchronize data with a cloud service?
Svetllana [295]

Answer:

Internet

Explanation:

The "Cloud" is an Online service this means it works on the Internet and without the Internet you can't have access to it.

7 0
3 years ago
Other questions:
  • True or false: a cover letter accompanies a resume to showcase a job-seeker’s personal life
    6·2 answers
  • Which device or software application detects errors in system configurations?
    8·1 answer
  • Why do most laptops have LCD rather than OLED displays, which are found on mobile devices?
    14·1 answer
  • During the Cold War, defense contractors were required to shield sensitive computing systems and prevent electronic eavesdroppin
    14·1 answer
  • Which of the selections below is not a benefit of imaging the computers on your network? There are fewer licensing fees because
    11·1 answer
  • A company that provides finance services wants to shift to a mobile platform. What is the major advantage that the users of the
    10·2 answers
  • Write an algorithm that receives a number from the user (you can store the number in a variable called N). Then the algorithm sh
    8·1 answer
  • The purpose of​ a/an _________ system is to capture best practice solutions and program them into a set of rules in a software p
    13·1 answer
  • Match the job description to the level of degree it requires.
    15·1 answer
  • How do i fix this to make it run ???
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!