bartleby

Concept explainers

Question
Book Icon
Chapter 18, Problem 3PP
Program Plan Intro

Students Records

Program Plan:

  • Include required header file.
  • Include required “std” namespace.
  • Define a structure for “StudentInfo”.
    • Declare variable for student name and grade.
  • Define the function for student records order.
  • Define main function
    • Declare variable “stud” in “vector” template class.
    • Create an object for student structure “StudentInfo”.
    • Declare and initializes the required variable.
    • Performs “do-while” loop. This loop executes until the option is not equal to “y” or “Y”.
      • Read the student name from user.
      • Read the student grade from user.
      • Then push the student name and their grade into vector using “push_back()” function.
      • Read the again option from user.
    • Then store the maximum size for student name.
    • Display the student records using “for” loop.
    • Then compute the maximum and minimum grade and after that compute the grade average.
    • Display the maximum, minimum and average grade.
    • Sort the names in student records using “sort” function.
    • Finally display the student names and their grades after sorting.

Blurred answer
Students have asked these similar questions
Write a simple trivia quiz game using c++ Start by creating a Trivia class that contains information about a single trivia question. The class should contain a string for the question, a string for the answer to the question, and an integer representing the dollar amount the question is worth (harder questions should be worth more). Add appropriate constructor and accessor functions. In your main function create either an array or a vector of type Trivia and hard-code at least five trivia questions of your choice. Your program should then ask each question to the player, input the player’s answer, and check if the player’s answer matches the actual answer. If so, award the player the dollar amount for that question. If the player enters the wrong answer your program should display the correct answer. When all questions have been asked display the total amount that the player has won.
Write a program that inputs, processes, and outputs a set of student records organized as a vector of structure StudentRec objects. write a program where each student record is a structure that looks like this: struct StudentRec { string last_name = "";          // Last name string first_name = "";         // First name int year_grad = 0;                  // Year expected to graduate float gpa = 0.0;                       // Current gpa }   The program should ask for the data to fill a studentRec of structure StudentRec and then ask y/n if they want to add another studentRec. Each studentRec will go into the vector of type StudentRec called student_list. After the student records have been entered into the vector student_list, find the average gpa of all the students in the vector. Output all the student records and give the average gpa for the students. Use the iomanip tools to make the data look as nice a possible. Write excellent comments: Critical or tricky parts that might…
A vector contains the grades obtained by students of a class in an assessment, with the following characteristics: Notes are actual values between zero and ten.If the value is equal to -1.0, then this means that the student has missed the assessment.The average approval rate at this University is 6 (six).Write a program that reads two vectors: the note vector described and a vector containing the students' names of the same size. As an output, print the following information in the console in this order: How many students missed the evaluation?How many students have been approved?Among the students present, how many students failed?Among the students present, what was the average grade, with up to two decimal places of accuracy?What's the name of the student who got the highest grade in the class?TipsCreate different counters to find the value of outputs 1 through 4. These counters are different from the loop counter that traverses the vector;Within the while loop, use five independent…
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning