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
Rainbow [258]
3 years ago
14

Write a python application that allows a user to enter any number of student test scores until the user enters 999. If the score

entered is less than 0 or more than 100, display an appropriate message and do not use the score. After all the scores have been entered, display the number of scores entered and the arithmetic average.
Computers and Technology
1 answer:
Kryger [21]3 years ago
7 0

Answer:

This program is as follows

<em>total = 0; count = 0</em>

<em>testscore = int(input("Score: "))</em>

<em>while testscore != 999:</em>

<em>    if testscore < 0 or testscore > 100:</em>

<em>        print("Out of range")</em>

<em>    else:</em>

<em>        total+=testscore</em>

<em>        count+=1</em>

<em>    testscore= int(input("Score: "))</em>

<em>print(count,"scores entered")</em>

<em>print("Arithmetic Average:",total/count)</em>

Explanation:

This initializes total and count to 0

total = 0; count = 0

This gets input for score

testscore = int(input("Score: "))

The following iteration stop when 999 is entered

while testscore != 999:

This prints out of range for scores outside 0 - 100

   if testscore < 0 or testscore > 100:

<em>        print("Out of range")</em>

Otherwise

   else:

The total score is calculated

       total+=testscore

The number of score is calculated

       count+=1

Get another input

   testscore = int(input("Score: "))

The number of score is printed

print(count,"scores entered")

The average of score is printed

print("Arithmetic Average:",total/count)

You might be interested in
List five kinds of view in the computer and briefly define each​
mr Goodwill [35]

Answer:

It responds to a specific set of instructions in a well-defined manner. It can execute a prerecorded list of instructions (a program).

5 0
2 years ago
#include
gavmur [86]

Answer:

See explaination

Explanation:

#include <fstream>

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

// Fill in the code to define payfile as an input file

ifstream payfile;

float gross;

float net;

float hours;

float payRate;

float stateTax;

float fedTax;

cout << fixed << setprecision(2) << showpoint;

// Fill in the code to open payfile and attach it to the physical file

// named payroll.dat

payfile.open("payroll.dat");

// Fill in code to write a conditional statement to check if payfile

// does not exist.

if(!payfile)

{

cout << "Error opening file. \n";

cout << "It may not exist where indicated" << endl;

return 1;

}

ofstream outfile("pay.out");

cout << "Payrate Hours Gross Pay Net Pay"

<< endl << endl;

outfile << "Payrate Hours Gross Pay Net Pay"

<< endl << endl;

// Fill in code to prime the read for the payfile file.

payfile >> hours;

// Fill in code to write a loop condition to run while payfile has more

// data to process.

while(!payfile.eof())

{

payfile >> payRate >> stateTax >> fedTax;

gross = payRate * hours;

net = gross - (gross * stateTax) - (gross * fedTax);

cout << payRate << setw(15) << hours << setw(12) << gross

<< setw(12) << net << endl;

outfile << payRate << setw(15) << hours << setw(12) << gross

<< setw(12) << net << endl;

payfile >> hours ;// Fill in the code to finish this with the appropriate

// variable to be input

}

payfile.close();

outfile.close();

return 0;

}

4 0
3 years ago
What is the extension of Qbasic ?​
abruzzese [7]

There are four types of operator in QBASIC. They are Arithmetic operators,relational operators,logical operators and sting operator .a. arithmetic operators. Arithmetic operators are used to preform mathematical calculations like addition, subtraction, division, multiplication and exponential

7 0
2 years ago
Read 2 more answers
On laptops with a smart card reader installed, where is the smart card reader usually located?
dem82 [27]
Plenty of space in the palm rest
4 0
2 years ago
IMPORTANT HELP
balu736 [363]

Answer:

plz am so sorry I don't no it

Explanation:

Plz give me brainiest

6 0
3 years ago
Other questions:
  • To select a number format, you can choose a category in the Number tab in the Format Cells dialog box and then select the number
    5·1 answer
  • Can anyone help me with getting bash ubuntu on windows setup?
    15·1 answer
  • Jerry’s managing a Google Search campaign and would like to improve the position in which his ads appear. He’s increased his bid
    15·1 answer
  • Almost immediately after a server migration project, employees are complaining that they can't reach the Internet. You sit down
    8·1 answer
  • Baking Cookies. Sweet Dough Inc. bakes cookies—a popular dessert—based on the quantities ordered by their customers. Three raw m
    12·1 answer
  • jakie krasnale mieszkaja we wroclawiu i opisz kto napisal kronike, prosze nie kopiowac dlugich tekstow najlepiej by bylo opisac
    6·1 answer
  • The game often becomes stuck on landscape mode when tilting the device during gameplay, which cuts off some peripheral text. A w
    8·1 answer
  • Which tools is used to bundle cables neatly inside and outside of a computer?​
    15·1 answer
  • What does this map key show
    12·1 answer
  • What online resource would you use if you wanted to read a review about a new movie?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!