You will create a class to store information about a student�s courses and calculate their GPA. Your GPA is based on the class credits and your grade. Each letter grade is assigned a point value:
A = 4 points
B = 3 points
C = 2 points
D = 1 point
An A in a 3 unit class is equivalent to 12 grade points (4 for the A times 3 unit class)
A C in a 4 unit class is equivalent to 8 grade points (2 for the C times 4 unit class)
This is a total of 20 grade points. Your GPA is calculated by dividing the total grade points by the total class credits, so in this case:
20 grade points / 7 credits = 2.85 GPA
Create a class called StudentInfo that represents the following information (private data) about a student:
Student name
Total grade points
Total credits
Create the following public member functions.
(Note that the program may not require all functions to be used, but they should all exist for a complete class.)
Default constructor to initialize grade points and credits
setName Set value for name
getName Returns the name
addClass receives as input the class units and grade, updates grade points and credits appropriately
getGPA Calculates and returns the GPA
displayStudent Displays all info about studetn
Note that ONLY student name will be �set� from the outside. The grade points and credits will be modified with the method AddClass which takes as parameters the number of units for the class and the grade awarded. This method then adds the appropriate grade points to the total, and also adds the credits to the total.
You will need a method to �get� the GPA which will calculate and return it.
Write a program to test the class as shown below. You should ask for the student�s name, then allow them to add multiple classes. When done, display the GPA.
Note that it will be easier to use String for the grade rather than char since Scanner does not have a method to easily return a char.
Sample Output (note formatting):
Enter Student name: Joe Smith
Enter class credits: 3
Enter letter grade: A
Another class? y
Enter class credits: 4
Enter letter grade: C
Another class? n
Joe Smith, your GPA is 2.86
Another employee? (Y/N): n
Press any key to continue
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
You will create a class to store information about a student�s courses and calculate their GPA....
Task: You want to calculate a student's GPA for a number of classes taken by the student during a single semester. (In C# (C sharp)) Inputs: 1. the student's name 2. Class names for the classes taken by the student 3. Class letter grade for the classes taken by the student 4. Class credit hours for the classes taken by the student Processing: 1. Accept and process classes until the user indicates they are finished 2. accumulate the number of...
Problem Specification:Write a C++ program to calculate student’s GPA for the semester in your class. For each student,the program should accept a student’s name, ID number and the number of courses he/she istaking, then for each course the following data is needed the course number a string e.g. BU 101 course credits “an integer” grade received for the course “a character”.The program should display each student’s information and their courses information. It shouldalso display the GPA for the semester. The...
A. Create a CollegeCourse class. The class contains fields for the course ID (for example, CIS 210), credit hours (for example, 3), and a letter grade (for example, A). Include get and set methods for each field. Create a Student class containing an ID number and an array of five CollegeCourse objects. Create a get and set method for the Student ID number. Also create a get method that returns one of the Student’s CollegeCourses; the method takes an integer...
A. Create a CollegeCourse class. The class contains fields for the course ID (for example, CIS 210), credit hours (for example, 3), and a letter grade (for example, A). Include get and set methods for each field. Create a Student class containing an ID number and an array of five CollegeCourse objects. Create a get and set method for the Student ID number. Also create a get method that returns one of the Student’s CollegeCourses; the method takes an integer...
A. Create a CollegeCourse class. The class contains fields for the course ID (for example, CIS 210), credit hours (for example, 3), and a letter grade (for example, A). Include get and set methods for each field. Create a Student class containing an ID number and an array of five CollegeCourse objects. Create a get and set method for the Student ID number. Also create a get method that returns one of the Student’s CollegeCourses; the method takes an integer...
you must implement public class Student by following the instructions as follows exactly. You may reference Chapter 7 for the similar examples to get the ideas and concepts. Each student must have the following 5 attributes (i.e., instance variables): private String studentID ; // student’s ID such as 1 private String lastName ; // student’s last name such as Doe private String firstName ; // student’s first name such as John private double gpa...
In Java
a. Create a class called StudentRecord that has the following private variables: year, GPA Implement 2 constructors: default constructor (doesn't take any parameters, has b. an empty body) and a constructor, that initializes all variables. according to the following template: Implement Comparable interface, so that StudentRecord class has ĢompareTo c. Implement a toString() method that returns text representation of an object First name: Benoit, last name: Mandelbrot, year: 3, GPA: 3.68 d. method, that performs comparison as the...
Create a class called Student. This class will hold the first name, last name, and test grades for a student. Use separate files to create the class (.h and .cpp) Private Variables Two strings for the first and last name A float pointer to hold the starting address for an array of grades An integer for the number of grades Constructor This is to be a default constructor It takes as input the first and last name, and the number...
PYTHON*************** Create a Person Class that: Accepts First Name, Last Name, Age, and Gender Has a method that adds all persons Validate all input, not left empty for First Name, Last Name, Gender and numeric for age and throw an exception if it does not validate within the class. Create a Student Class that: Inherits the Person Class Accepts GPA Validate GPA (>= 0 and <= 4.0) and throw exception if it does not validate within the class. Has methods...
A teacher wants to create a list of students in her class. Using the existing Student class in this exercise. Create a static ArrayList called classList that adds a student to the classList whenever a new Student is created. In the constructor, you will have to add that Student to the ArrayList. Coding below was given to edit and use public class ClassListTester { public static void main(String[] args) { //You don't need to change anything here, but feel free...