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...
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...
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]
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 ____...
(JAVA) Create a program that prompts the user for an age input. The program defines the...
(JAVA) Create a program that prompts the user for an age input. The program defines the age group of the user. Follow the table below to construct the output for your program. Age Age Group 0 Baby 1-3 Toddler 4-11 Child 12-17 Teenager 18-21 Young Adult 22-64 Adult 65+ Senior Negative Number Invalid Input Sample Input Enter an age: 18 Sample Output: You are a young adult. Sample Input Enter an age: 29 Sample Output: You are an adult. Sample...
Code using assembly language Create a program using the Irvine32 procedures were the user can input...
Code using assembly language Create a program using the Irvine32 procedures were the user can input a list of 32-bit unsigned integers an “x” number of times, then display these integers to the console in reverse order. Hint: Use loops and PUSH & POP instructions. Extra Challenge: Inform the user with a message what to do; also, tell them what they are seeing.
In visual Studio C++ Create a program that uses a for loop to input the high...
In visual Studio C++ Create a program that uses a for loop to input the high temperature, and low temperature for each day of the week. The high and low will be placed into two elements of the array. For each loop the high and low will be placed into the next set of elements of the array. After the temps for all seven days have been entered into the array, a for loop will be used to pull out...
First, write a program to loop asking for a number from the user until the user...
First, write a program to loop asking for a number from the user until the user inputs a zero or until the user has input 50 numbers. Store each value in an array except the values that are divisible by 5 and display all stored values. Determine how many of the values stored in the array were divisible by 10 and display result. Next, write a function getMinMax that accepts an array of floats and the size of the array,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT