Small Basic Programming
Question: Average score
Write a program that uses loops to collect data and calculate the average score over a number of tests for a number of students.
The program should :
1. first ask the user to enter the number of students in the range of 1 to 10.
2. then the program asks the user to enter the number of tests (in the range of 1 to 5)
3. Then use a loop to collect the scores for those many tests for each student. The outer loop will iterate once for each student. The inner loop will iterate several times, once for each test. Each iteration of the inner loop will ask the user to enter the score for a test of a student.
3. After all iterations, the program should calculates and display the total scores and average score for each student.
Screenshot of the code with explanation:

The Output of the Code:

The Code Used:
TextWindow.Write("Enter the number of Students(range 1 to 10): ")'message to the user to enter the number of students
numOfStudents = TextWindow.Read() 'Taking the input
TextWindow.Write("Enter the number of Tests(range 1 to 5): ") 'message to the user for the number of tests.
numOfTests = TextWindow.Read() 'Taking the input
TextWindow.WriteLine("")
for student=1 to numOfStudents 'outside loop will iterate for every student
for test=1 to numOfTests 'inside loop will take all the test scores of a particular student
TextWindow.Write("Enter the test"+test+" score for student"+student+": ")
number[student][test] = TextWindow.Read() 'We are taking the input and storing it in a number array.
EndFor
TextWindow.WriteLine("")
EndFor
for student=1 to numOfStudents 'we iterate through the loop again to sum the test score's of individual students.
sumOfTest = 0 'This variable will store the sum of scores of one student at a time.
for test=1 to numOfTests
sumOfTest = sumOfTest + number[student][test] 'we are adding the scores of student to the sumOfTest.
EndFor
TextWindow.WriteLine("The total score of student"+student+": "+sumOfTest) 'total score of the student
'the totalScore when divided by the number of tests will give us the average.
TextWindow.WriteLine("The average score of student"+student+": "+sumOfTest/numOfTests)'The average
TextWindow.WriteLine("")
EndFor
I hope you like the solution. In case of any doubts regarding the solution feel free to ask it in the comment section. If you like the solution please give a thumbs up.
Small Basic Programming Question: Average score Write a program that uses loops to collect data and...
Small Basic Programming Question: Average Score- Write a program that uses loop to collect data and calculate the average score over a number of tests for a number of students. The program should: 1. first ask the user to enter the number of students in the range of 1 to 10. 2. then the program asks the user to enter the number of tests (in the range of 1 to 5) 3. Then use a loop to collect the scores...
Average Rainfall Design a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month. After all iterations, the program should display the number of...
***** JAVA ONLY ***** Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. Frist the program should ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate 12 times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month. After all iterations, the program should display the...
Write them in python IDLE *****
5. Average Rainfall
Write a program that uses nested loops to collect data
and calculate the average rainfall over a period of years. The
program should first ask for the number of years. The outer loop
will iterate once for each year. The inner loop will iterate twelve
times, once for each month. Each iteration of the inner loop will
ask the user for the inches of rainfall for that month. After all
iterations,...
Design a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterte twelve times, onece for each month. Each itertion of the inner loop will ask the user for the inches of rainfall for tht month. After all iterations, the program should display the number of months, the...
5. Create a java application that uses nested loops to collect data and calculate the average rainfall over a peniod of years First the program should ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate 12 times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month, the program should display the number of months, the total...
Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should prompt the user for the number of years. Be sure to ask for each months average rainfall for each year. The outer loop will iterate once for each year while the inner loop will iterate 12 times(one time per month) prompting for the months average rainfall on each iteration. Display the number of months, the total inches...
Write a program that will calculate each student’s average score over several tests. The program will ask for the number of students, and the number of scores per student. Then, for each student, it will ask for all test results and display the average. The output should look similar to what is shown below (sample user input is shown in bold) ( write by python and Screenshot it for me , thank) How many students do you have? 3 How...
In this assignment, you will write a program in C++ which uses files and nested loops to create a file from the quiz grades entered by the user, then reads the grades from the file and calculates each student’s average grade and the average quiz grade for the class. Each student takes 6 quizzes (unknown number of students). Use a nested loop to write each student’s quiz grades to a file. Then read the data from the file in order...
In C++ Write a program that calculates the occupancy rate for a hotel. The program should start by asking the user how many floors the hotel has. A loop should then iterate once for each floor. In each iteration, the loop should ask the user for the number of rooms on the floor and how many of them are occupied. After all iterations, the program should display how many room the hotel has, how many of them are occupied, how...