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
yKpoI14uk [10]
3 years ago
6

Write a program that will input a list of test scores in from the keyboard. When the user enters -1, print the average.

Computers and Technology
2 answers:
never [62]3 years ago
7 0

print("Enter the Scores:")

total = []

while True:

   num = int(input())

   if num == -1:

       break

   total.append(num)

print("The average is:",(sum(total)/len(total)))

I wrote my code in python 3.8. Also, you have to be careful about adding -1 to the total. You don't want to count -1 in the average.

aivan3 [116]3 years ago
3 0

Answer: -1 usually represents infinity.

Explanation:

It would keep going forever and not be able to stop without manually stopping it.

You might be interested in
Choose the 3 Points in good story telling
Sidana [21]

Answer:

1.Choose a clear central message 2. Embrace conflict 3.Have a clear structure  

Explanation:

8 0
2 years ago
. Write a function definition as follows: it returns the C++ form of a Boolean value, its function identifier is anyTwoTheSame,
Paraphin [41]

Answer:

The c++ code to implement the Boolean function is given. The function definition is shown.

bool anyTwoTheSame(float a, float b, float c)

{

   bool same = false;    

   if(a == b)

       same = true;

   else if(a == c)

       same = true;

   else if(b == c)

       same = true;        

   return same;

}

Explanation:

This function accepts three floating point numbers and returns true if any two numbers are equal else returns false.

The program below shows the implementation of this method.

#include <iostream>

using namespace std;

bool anyTwoTheSame(float a, float b, float c);

bool anyTwoTheSame(float a, float b, float c)

{

   bool same = false;    

   if(a == b)

       same = true;

   else if(a == c)

       same = true;

   else if(b == c)

       same = true;        

   return same;

}

int main() {    

   float one=12.34, two=56.78, three=90.1;    

   cout<<"Two numbers are same : " <<anyTwoTheSame(one, two, three);

}

OUTPUT

Two numbers are same : 0

The method is first declared.

bool anyTwoTheSame(float a, float b, float c);

Next step is method definition which shows what the function is supposed to do. The test to check equality of two numbers is implemented as shown.

bool same = false;    

if(a == b)

       same = true;

   else if(a == c)

       same = true;

   else if(b == c)

       same = true;  

This is the simplest test which can be programmed.

If the numbers are not same, the Boolean variable, same, remains initialized to false.

This function is then called in main method.

No user input is taken as this is not specified in the question.

The three floating variables are declared and initialized inside the main. The values are put inside the program and not taken from the user.

The output shows either 0 or 1. 0 represents false and 1 represents true.

This program can be tested for different values of floating variables.

3 0
3 years ago
Which of these is the function of a modeler?
Liono4ka [1.6K]

Answer:

Create 3D assets from sketches

Explanation:

A modeler Job is to model all of the 3D/2D assets needed to obtain the final result wanted by the developers. The modeler creates the assets from sketches or images provided to him according to the theme.

5 0
3 years ago
Read 2 more answers
Explain that is internet and how it function​
dimaraw [331]
The internet is a worldwide computer network that transmits a variety of data and media across interconnected devices. It works by using a packet routing network that follows Internet Protocol (IP) and Transport Control Protocol (TCP).

Source : HP TECH TAKES
4 0
3 years ago
Read 2 more answers
Please help it's my last question
Yuki888 [10]

Explanation:

here is your answer.. of. different between client / server architecture and peer to peer architecture of the network.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Write an application that allows a user to enter any number of student quiz scores until the user enters 99. If the score entere
    15·1 answer
  • The labor market shows the:
    11·1 answer
  • What is the difference between a key and a superkey?
    10·1 answer
  • The engineering firm you work for is submitting a proposal to create an amphitheater at a state park. Proposals must be submitte
    15·1 answer
  • Employee names are stored using a maximum of 50 characters. This information is an example of which of the following?
    9·1 answer
  • In the Microsoft Office Suite, what tells a database what to insert information in the document? 
    8·1 answer
  • Cuál es el objetivo principal de una clave primaria?
    14·1 answer
  • Please help with my Python code - Functions
    9·1 answer
  • Does watching Beastars make me a furry? ​
    12·1 answer
  • Need help with this please
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!