Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ please, and i need EXACT OUTPUT with the proper endline. Define a structure, named StudentScores, that contains four member variables, including name (a

In C++ please, and i need EXACT OUTPUT with the proper endline.

Define a structure, named StudentScores, that contains four member variables, including name (a string), mathScore (an integer), scienceScore (an integer), socialStudyScore (an integer).

Write a program to accept a number of students' records from the standard input. You can safely assume that the number of students to be entered is not more than 10. The input of student' records are in the following format

     

number of students indicates the number of students' scores to be entered next.

The following shows an example input

3 Sharp Shark 100 96 93 Ya Hoo 88 89 95 Apple Juice 91 92 89 

(1) Declare a StudentScores array to store the students' score information. Print out all the students' scores received in the following format

, Math: , Science: , Social Study:  

(2) Update the score of a course of a particular student. The program will print out a message:

Please enter a student's name, followed by the course name and the new score in a separate line: 

Given the following input from the standard input

Ya Hoo Math 95 

The program will then output:

Updated Math score of Ya Hoo: Ya Hoo, Math: 95, Science: 89, Social Study: 95 

You can safely assume that the student whose score will be updated always exists in the list of input students.

You should define and call the following function to update the score of a given student

void updateStudentScore(StudentScores &student, string whichCourse, int newScore); // student corresponds to the student whose score needs to be updated, whichCourse indicates which course's score should be updates ("Math", "Science", or "Social Study"), and newScore is the updated score.

Hint: use getline() to receive student's names as they may contain whitespaces. Also, call cin.ignore() before calling getline() to ensure correct reading. image text in transcribed

Define a structure, named StudentScores, that contains four member variables, including name (a string), mathScore (an integer), scienceScore (an integer), socialStudyScore (an integer). Write a program to accept a number of students' records from the standard input. You can safely assume that the number of students to be entered is not more than 10. The input of student' records are in the following format number of students indicates the number of students' scores to be entered next. The following shows an example input 3 Sharp Shark 100 96 93 Ya Hoo 88 89 95 Apple Juice 91 92 89 (1) Declare a StudentScores array to store the students' score information. Print out all the students' scores received in the following format , Math: , Science: , Social Study: (2) Update the score of a course of a particular student. The program will print out a message: Please enter a student's name, followed by the course name and the new score in a separate line: Given the following input from the standard input Ya Hog Math 95 The program will then output: Updated Math score of Ya Hoo: Ya Hoo, Math: 95, Science: 89, Social Study: 95 You can safely assume that the student whose score will be updated always exists in the list of input students. You should define and call the following function to update the score of a given student void updateStudentScore(StudentScores &student, string whichcourse, int newscore); // student corresponds to the student whose score needs to be updated, which course indicates which course's score should be updates ("Math", "Science", or "Social Study), and newScore is the updated score. Hint: use getline() to receive student's names as they may contain whitespaces. Also, call cin.ignore before calling getline() to ensure correct reading

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions