Question
This should be written in C++. Create a class with the name Student. private data members of the Student class should include: int - rollno
This should be written in C++.
Create a class with the name "Student".
private data members of the Student class should include:
int - rollno (roll number or id number of student)
string - name (name of student)
int - alg, datastruct, architect, proglang (hold scores out of 100 for these 4 classes)
float - per (average score of 4 classes above)
char - grade (letter grade based on per.. example 90 is an A)
public member functions of the Student class should include:
getdata() (function to accept data from user
showdata() (function to show data on screen
Create a constructor that initializes all int to 0, float to 0.0, char to ' ', name = "NoName".
Prompt the user for a valid class size.
Prompt the user for student data.
Store students in a vector.
Display student data including students average score and letter grade.
The following is an example:
Enter size of class: 0 Invalid class size Enter size of class: 1 Enter the roll number of student: 45 Enter The Name of student: Trish Duce Enter the grade in Algorithms out of 100: 88 Enter the grade in Data Structures out of 100: 94 Enter the grade in Architecture out of 100: 98 Enter the grade in Programming Languages out of 100: 92 Roll number of student: 45 Name of student: Trish Duce Grade in Algorithms: 88 Grade in Data Structures: 94 Grade in Architecture: 98 Grade in Programming Languages: 92 Percentage of student is: 93 Grade of student is: A
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started