Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a C++ class, named student, with the following specifications Private members of class student -admno: integer -sname: character array is size 20 -eng: real

Define a C++ class, named student, with the following specifications

Private members of class student

-admno: integer

-sname: character array is size 20

-eng: real

-math: real

-science: real

-total: real

-ctotal(): a function that returns the sum of eng, math and science

Public member function of class student

-inputData(): Accepts values for admno, sname, eng, science, interactively, and invokes ctotal() to set total.

-printData(): Displays all the data members, descriptively

#include

#include

#include

using namespace std;

//Place your class definition here

int main () //This is your main driver. Do NOT make any changes to it

{

student obj ;

obj.inputData();

obj.printData();

return 0;

}

//Place your class member function definitions here

Your output correctly ends with

1: output1

Input

12569

Kyle Smith

98

76

67

Your output correctly ends with

Admission number: 12569

Student name: Kyle Smith

English: 98

Math: 76

Science: 67

Total: 241

2: output2keyboard_arrow_up

0 / 15

Output differs. See highlights below.

Input

5398

Mary Quille

100

-30

70

Your output ends with

scores for your courses...

English: 98

Math: 76

Science: 67

Admission number: 12569

Student name:Kyle Smith

English: 98

Math: 76

Science: 67

Total: 241

Expected output ends with

Admission number: 5398

Student name: Mary Quille

English: 100

Math: -30

Science: 70

Total: 140

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

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago