Create a class of type student .Members will include: name, gpa, rank (year) Make sure all data is private and all functions are public. Write member functions to:Set or initialize the dataRetrieve the data (get’em and set’em )Announce names of students who are eligible for a scholarship (those who have a GPA of 3.0 or higher)The program will declare at least two objects (pupils) of your new class and test each of the functions (OR if you would like to try your hand at vectors, create them dynamically- this may require a little research/review on your part).

Question
Asked Oct 17, 2019
154 views

Create a class of type student .
Members will include: name, gpa, rank (year)
Make sure all data is private and all functions are public.
Write member functions to:
Set or initialize the data
Retrieve the data (get’em and set’em )
Announce names of students who are eligible for a scholarship (those who have a GPA of 3.0 or higher)
The program will declare at least two objects (pupils) of your new class and test each of the functions (OR if you would like to try your hand at vectors, create them dynamically- this may require a little research/review on your part).

check_circle

Expert Answer

Step 1

The name of the class is Student.

All data is a private member of the class.

All function is a public member of the class.

This program prompts the user to enter the total number of students which data you want to enter.

The user has to enter the name, GPA, and rank of that student.

If the student GPA is greater or equal than  3.0 then the student is eligible for the scholarship.

This program displays the name of the students who are eligible for the scholarship.

Step 2

/*Program to find that student is eligible for scholarship are not.*/

//header file

#include <iostream>

 

using namespace std;

//declare a class called student

class Student

{

    //private member of class

private:

   string Name;

   float GPA;

   int Rank;

   //public member of class

public:

    //member function to return student name

    string getName()

   {

       return Name;

   }

   //member function to return student name

   float getGPA()

   {

       return GPA;

   }

   //member function to return student name

   int getRank()

   {

       return Rank;

   }

   //member function to get student name

   void setName(string studentName)

   {

       this->Name = studentName;

   }

   //member function to get student GPA

   void setGPA(float studentGpa)

   {

       this->GPA = studentGpa;

   }

   //member function to get student Rank

   void setRank(int studentRank)

   {

       this->Rank = studentRank;

   }

  

};

 

int main()

{

    //variable declaration

    int totalStudent;

    //prompt user to enter total number of student

    cout << "Enter total Number of Students which data you want to enter: ";

    cin>>totalStudent;   

    //declare array of Student

    Student std[totalStudent];

   

    //variable declaration

    char studentName[25];

    float studentGpa;

    int studentRank;

  &n...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: please just help with parts afterr //     3) Write friend function for the following class to overlo...

A: A friend function is defined outside the context of a class, but it has the rights to access the mem...

question_answer

Q: Code needed for the following: Use the final numerical grade to look up the corresponding letter gra...

A: This C++ program obey the following rubrics: -In main method – Declaring and initializing the variab...

question_answer

Q: Describe the process of how to solve the substitution cipher below and solve it: ZFSZB YESUK SQYDJ S...

A: The process is as follows:scan to look for single letter words – they would most likely correspond t...

question_answer

Q: whats a string

A: String:A string is a data type used in programming, such as an integer and floating point unitThe st...

question_answer

Q: CAREER B VENT LYY a sqeo1 NON 0LO no o N aND Welcome | MYSAIL Oakland Un X Th Course: CSI-1420-43702...

A: This program is written in C language. Year is given as input and Easter Sunday's Month and day is c...

question_answer

Q: I have a bit of code that is intended to read a file ("students.txt") and calculate the average, hig...

A: Description:The following program is to print the highest, lowest, and average of test scores by rea...

question_answer

Q: What are the different computer languages? Give a brief description of each.

A: DefinitionLanguage is the basic way of communication between the computer systems and to communicate...

question_answer

Q: You are given a function called is_prime  which consumes a positive number and returns True if the n...

A: Before solving this question first, you should know some functions definitions :Prime number: Primar...

question_answer

Q: Which of the following is NOT logically equivalent to the rest: wx~y + w~z + wxyz + w~yz w(x + ~y +...

A: Using a Karnaugh Map to find the minimal sum-of-products for the expressions we get the following (c...