Write the Flowchart and Python code for the following programming problem based on the provided pseudocode. Write a program that will allow a teacher to calculate the average test score for a certain number of students. The teacher can enter the number of students who took the test, and then the score for each student. Your program will then calculate the average score and print out the results. Your program must use the appropriate loop, modules, and run multiple times for different sets of test scores. Your sample output might look as follows: How many students took the test: 9 Enter their score: 98 Enter their score: 78 Enter their score: 99 Enter their score: 92 Enter their score: 87 Enter their score: 100 Enter their score: 88 Enter their score: 81 Enter their score: 79 The average test score is 89 Do you want to end program? (Enter no to process a new set of scores): yes The Pseudocode Module main() //Declare local variables Call declareVariables (endProgram, totalScores, averageScores, score, number, counter) //Loop to run program again While endProgram == “no” //reset variables Call declareVariables (endProgram, totalScores, averageScores, score, number, counter) //calls functions Call getNumber(number) Call getScores(totalScores, number, score, counter) Call getAverage(totalScores, number, averageScores) Call printAverage(averageScores) Display “Do you want to end the program? (Enter no to process a new set of test scores )” Input endProgram End While               End Module Module declareVariables(Real Ref endProgram, Real Ref totalScores, Real Ref averageScores, Real Ref score, Integer Ref number, Integer Ref counter) Declare String endProgram = “no” Declare Real totalScores = 0.0 Declare Real averageScores = 0.0 Declare Real score = 0 Declare Integer number = 0 Declare Integer counter = 1 End Module Module getNumber(Integer Ref number) Display “How many students took the test: ” Input number End Module Module getScores(Real Ref totalScores, Integer number, Real score, Integer counter) For counter = 1 to number Display “Enter their score:” Input score Set totalScores = totalScores + score End For End Module Module getAverage(Real totalScores, Integer number, Real Ref averageScores) Set averageScores = totalScores / number End Module Module printAverage(Real averageScores) Display “The average scores is “, averageScores End Module

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Write the Flowchart and Python code for the following programming problem based on
the provided pseudocode.
Write a program that will allow a teacher to calculate the average test score for a certain
number of students. The teacher can enter the number of students who took the test, and
then the score for each student. Your program will then calculate the average score and
print out the results. Your program must use the appropriate loop, modules, and run
multiple times for different sets of test scores.
Your sample output might look as follows:
How many students took the test: 9
Enter their score: 98
Enter their score: 78
Enter their score: 99
Enter their score: 92
Enter their score: 87
Enter their score: 100
Enter their score: 88
Enter their score: 81
Enter their score: 79
The average test score is 89
Do you want to end program? (Enter no to process a new set
of scores): yes
The Pseudocode
Module main()
//Declare local variables
Call declareVariables (endProgram, totalScores, averageScores, score, number, counter)
//Loop to run program again
While endProgram == “no”
//reset variables
Call declareVariables (endProgram, totalScores, averageScores, score, number,
counter)
//calls functions
Call getNumber(number)
Call getScores(totalScores, number, score, counter)
Call getAverage(totalScores, number, averageScores)
Call printAverage(averageScores)
Display “Do you want to end the program? (Enter no to process a new set of test
scores )”
Input endProgram
End While
 
 
 
 
 
 
 
End Module
Module declareVariables(Real Ref endProgram, Real Ref totalScores, Real Ref averageScores,
Real Ref score, Integer Ref number, Integer Ref counter)
Declare String endProgram = “no”
Declare Real totalScores = 0.0
Declare Real averageScores = 0.0
Declare Real score = 0
Declare Integer number = 0
Declare Integer counter = 1
End Module
Module getNumber(Integer Ref number)
Display “How many students took the test: ”
Input number
End Module
Module getScores(Real Ref totalScores, Integer number, Real score, Integer counter)
For counter = 1 to number
Display “Enter their score:”
Input score
Set totalScores = totalScores + score
End For
End Module
Module getAverage(Real totalScores, Integer number, Real Ref averageScores)
Set averageScores = totalScores / number
End Module
Module printAverage(Real averageScores)
Display “The average scores is “, averageScores
End Module
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education