Question

In: Computer Science

create a program using IDLE where you will gather input from the user using a loop....

create a program using IDLE where you will gather input from the user using a loop. The user needs to provide you with a list of test scores for two categories (two different classrooms). Test scores must be integer values between 0 and 10. You need to process each score so that you can output the following:

Number of test scores entered for classroom A.

Number of test scores entered for classroom B.

Average of test scores entered for classroom A.

Average of test scores entered for classroom B.

EX:

Classroom A (a), Classroom B(b) or Quit (q): a
room A score: 10
Classroom A (a), Classroom B(b) or Quit (q): b
room B score: 8
Classroom A (a), Classroom B(b) or Quit (q): a

room A score: 8
Classroom A (a), Classroom B(b) or Quit (q): q
You entered 2 score(s) for room A with an average of 9.0

You entered 1 score(s) for room B with an average of 8.0

Solutions

Expert Solution

i = True

s1 = 0

s2 = 0

a = []

b = []

while (i == True): #iterate till input = q

print("Classroom A (a), Classroom B(b) or Quit (q):")

n = input()

if(n == 'a'):

a.append(int(input())) # classroom a values entered into list a

if(n == 'b'):

b.append(int(input())) # classroom a values entered into list b

if(n == 'q'):

for j in a:

s1 = s1 + j #calculating sum in class A

for k in b:

s2 = s2 + k #calculating sum in class b

print("You entered", len(a)," score(s) for room A with an average of ",(float(s1)/len(a))) #calualting average and output the result

print("You entered", len(b)," score(s) for room A with an average of ",(float(s2)/len(b))) #calualting average and output the result

i = False


Related Solutions

create a program using IDLE where you will gather input from the user using a loop....
create a program using IDLE where you will gather input from the user using a loop. The user needs to provide you with a list of test scores for two categories (two different classrooms). Test scores must be integer values between 0 and 10. You need to process each score so that you can output the following: Number of test scores entered for classroom A. Number of test scores entered for classroom B. Average of test scores entered for classroom...
Program 3.5 - Conversion Program   - NOW using cin statements to gather input from user Concepts...
Program 3.5 - Conversion Program   - NOW using cin statements to gather input from user Concepts Covered:  Chapter 2 – cout ,   math, data types, Chapter 3 , gathering both numeric & string input from user Programs 2-21, 2-22, 2-23, 2-28 should help with math and programs 3.5, 3.17 and 3.19 should help you with the new concepts introduced with this program. Program Purpose:  To help you understand the concept of using both proper numeric variables and string variables. To give you practice...
Introduction to Java Programing Using Loop Create a simple calculator program using loop Ask user to...
Introduction to Java Programing Using Loop Create a simple calculator program using loop Ask user to input two numbers using scanner class Print the instruction of the menu for the calculator program Ask user to press 0 to Quit Ask user to press 1 to Add Ask user to press 2 to Substract Ask user to press 3 to Multiply Ask user to press 4 to Divide Perform correct calcuation based on user inputs and print the result Print error...
Using C++ Create a program that asks the user to input a string value and then...
Using C++ Create a program that asks the user to input a string value and then outputs the string in the Pig Latin form. - If the string begins with a vowel, add the string "-way" at the end of the string. For “eye”, it will be “eye-way”. - If the string does not begin with a vowel, first add "-" at the end of the string. Then rotate the string one character at a time; that is, move the...
You are to create a program to request user input and store the data in an...
You are to create a program to request user input and store the data in an array of structures, and then display the data as requested. The data you are collecting refers to a set of images. The images are OCT images taken of the lining of the bladder. The data you provide will help diagnose the image as cancerous or not, but your code does not need to do that at the moment. First, Define a global structure that...
You are to create a program to request user input and store the data in an...
You are to create a program to request user input and store the data in an array of structures, and then display the data as requested. The data you are collecting refers to a set of images. The images are OCT images taken of the lining of the bladder. The data you provide will help diagnose the image as cancerous or not, but your code does not need to do that at the moment. 1) Define a global structure that...
Using RAPTOR create a program that allows the user to input a list of first names...
Using RAPTOR create a program that allows the user to input a list of first names in on array and last names into a parallel array. Input should be terminated when the user enters a sentinel character. the output should be a list of email address where the address is of the following form: [email protected]
In C: You are to create a program to request user input and store the data...
In C: You are to create a program to request user input and store the data in an array of structures, and then display the data as requested. The data you are collecting refers to a set of images. The images are OCT images taken of the lining of the bladder. The data you provide will help diagnose the image as cancerous or not, but your code does not need to do that at the moment. 1) Define a global...
Create the logic for a rhyming program that takes in five words from a user input...
Create the logic for a rhyming program that takes in five words from a user input and replaces the selected rhyming words with the user's input, then creates and displays the Humpty Dumpty rhyme with the five words from the user input. Hint: 1. You will use the sentinel values: start and stop 2. The program will ask the user for 5 words. 3. The program will store the 5 words 4. The program outputs the rhyme replacing the ____...
IN PYTHON create a python program that accepts input from the user in the following sequence:...
IN PYTHON create a python program that accepts input from the user in the following sequence: 1. Planet Name 2. Planet Gravitational Force(g) for data, use the planets of our solar system. The data input is to be written in 2 separate lists, the names of which are: 1. planetName 2. planet GravitationalForce(g) A third list is required that will store the weight of a person with mass of 100kg, the formula of which is: W=mg(where m is mass of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT