Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help completing the following program: Objective: The purpose of this lab project is to expose you to structures and classes. Problem Specification: Using

I need help completing the following program:

Objective:

The purpose of this lab project is to expose you to structures and classes.

Problem Specification:

Using a structure:

You are to write a program that will define a structure consisting of the following data members, fields:

Name - a string

Student id number an integer.

Three test scores positive short integers.

Average a float

Grade a character.

Input to the program consists of:

name

id number

three test scores

Requirements:

Use a function to read the name, id number and three test scores, the function will return a structure.

A function to find the average, the function is a void function that takes the entire structure as an argument (by reference) and calculates the average.

A function that takes the average as argument and returns the grade (A,B,C,D, or F) using standard grading.

A function that prints each data member of the structure on a separate line and calls another function that prints the message You Passed or You Failed.

Using a class:

You are to write a program that will define a class consisting of the following data members:

Name - a string

Student id number an integer.

Three test scores - short integers.

Input to the program consists of:

name

id number

three test scores

Requirements:

Must use a project with three files (a specification, an implementation, and a client file)

Must define a null destructor, and a constructor with default arguments to initialize data members to null or zero.

Use a setter function to read the name, id number and three test scores from the keyboard.

A getter function that prints each data member of the object on a separate line and uses two private functions that will find the average and grade (local to print) to be printed. Print will also print You Passed or You Failed.

All getter functions are constant with constant parameters.

Your output, for both, should be a report like follows:

Student Name : Jim Donavan

Id Number : 2345

Tests :

1-78

2-88

3-98

Average : 88.00

Grade : B You Passed.

Grading criteria:

Structure implementation

5 points Good programming practices: Proper spacing, comments, use of descriptive variables, indentation and appearance of program.

5 points typedef is used to define a structure and the new type is used where needed.

5 points every function has specifications.

5 points Hierarchical chart is handed-in and is correct.

25 points Requirements above are followed.

5 points test results are handed in.

Class Implementation

5 points project has three files

3 points Guards are included.

2 points destructor function is defined as requested.

5 points constructor functions is defined as requested.

5 points every function has specifications.

5 points class diagram including access specifiers is handed-in and is correct.

20 points Requirements above are followed.

5 points test results are handed in.

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

Database Management System MCQs Multiple Choice Questions And Answers

Authors: Arshad Iqbal

1st Edition

1073328554, 978-1073328550

More Books

Students also viewed these Databases questions

Question

5. What information would the team members need?

Answered: 1 week ago

Question

Where those not participating, encouraged to participate?

Answered: 1 week ago