Homework Help Question & Answers
convert pseducode to c++ Starting out with Programming Logic and Design (3) – Read-only Terates once…
convert pseducode to c++
Starting out with Programming Logic and Design (3) – Read-only Terates once for each student. The nested inner loop, in lines 27 through 31, iterates once for each test score. Program 5-20 1 1 This program averages test scores. It asks the user for th 2 1/ number of students and the number of test scores per stude Declare Integer numStudents 4 Declare Integer numTest Scores 5 Declare Integer total 6 Declare Integer student 7 Declare Integer testNum 8 Declare Real score 9 Declare Real average 11 // Get the number of students. 12 Display “How many students do you have?” 13 Input numStudents 15 // Get the number of test scores per student. 16 Display “How many test scores per student? 17 Input numTest scores 19 // Determine each student’s average test score. 20 For student 1 Tonstudents // Initialize an accumulator for test scores. Set total = 0 // Get a student’s test scores. Display “Student number, student Display For testNum 1 To nunTest Scores Display “Enter test number – testNum Inout score Set total = total + score “: End For // calculate the average test score for this student. Set average = total / numTestScores // Display the average. Display “The average for student “. student,” is “, aver Display End For 39
Add a comment