Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the C + + program according to following scenario: Write a C + + program that will have a user defined data type Student.

Write the C++ program according to following scenario:
Write a C++ program that will have a user defined data type Student. Follow the given
details and use structure to create it.
The Student structure includes the attributes- id, name, cgpa, numberOfCreditsCompleted
Implement the following methods within the struct -
setData for setting all the student information and display for displaying the student details.
Additionally, include one operational method called getScholarshipPercent, this function
is used to check whether the student is applicable for scholarship or not. The student is
eligible for a 40% scholarship if their cgpa is greater than or equal to 3.85 and their
numberOfCredits exceeds 45. The student is eligible for a 20% scholarship if their cgpa
is greater than or equal to 3.75 and their numberOfCredits exceeds 45. Otherwise, the
percentage is 0%. The percentage of the scholarship is returned by the function.
In main function create an instance of Student structure and use setData to initialize the
information about the student. After that Check whether the student is applicable for
scholarship or not. Finally, print the information by using display function.
Do the same thing using class Student
image text in transcribed

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

Students also viewed these Databases questions