Starting from:
$35

$29

Programming Assignment 2 Solution

Using C++ , design an Abstract Data Type class named MyGrades. The class

must have the following private members :

• Vectors to hold grades for Programming Assignments and Midterm

Exams .

• Programming Assignments will count as 20 % , Exam 1 will count as 20

% , and Exam 2 will count as 25%..

In Addition , the class should have the following seven member functions :















Set Programming Assignment Grades

Set test grades

Show all programming assignment grades and calculating the average.

Show all test grades

Show overall grades

Delete A Programming Assignment Grade

Delete A Test Grade

Notes :

• Must define a class and its functions, followed by implementation of

class functions, and finally followed by main program to run the

program. All in one .cpp.

• Programming assignments and test grades must be defined as double.

Characters and other form must be rejected.

• Selection must be 1 – 9 and 9 . Otherwise it is rejected.

• Program must continue until the user enters 9 to exit the program.

• Output values must include 2 numeric values after the decimal point.




Validations :

• Only integers are allowed as.

• Programming assignment grades are between 0 and 10

• Test grades are between 0 and 25

Style Guidelines

:

At the beginning of your program ( and before the #include statement ), include the following :

Header comments (file documentation block) should be at the top of each file and

should contain: Author / s, Due Date, Assignment Number, Course number and

section, Instructor, and a brief description of the purpose of the code in the file. For

example :

//

//

//

//

//

//

//

//

Author / s : (Your name / s and serial number / s here!!) -

Due Date :

Programming Assignment Number 2

Spring 2018 - CS 3358 - Section Number

Instructor: Husain Gholoom.

<Brief description of the purpose of the program

Variable names :







Must be meaningful.

The initial letter should be lowercase, following words should be capitalized, no other

caps or punctuation ( i.e. weightInPounds

).

Each variable must be declared on a separate line with a descriptive comment.

Named constants :







Use for most numeric literals.

All capitals with underscores ( i.e. TX_STATE_SALES_TAX

Should occur at top of function, or global (only if necessary)







Line length of source code should be no longer than 80 characters (no wrapping of

lines).

Indentation :







Use 2-4 spaces (but be consistent throughout your program).

Indent blocks, within blocks, etc.

Use blank lines to separate sections.

Comments for variables :

All variable definitions should be commented as follows:

int

gender;

// integer value for the gender,

// 1 = Male , 2 = Female ,

Rules :

1. Your program must compile and run. The program will be tested using the latest

version of Codeblocks for windows.

2. Your program must be properly documented according the style above . See the

website for the sample programming style program.

3. You can use repetitions , control structures , try .. catch , and switch statements.

You are not allowed to use regular arrays nor global variables. You are allowed Only

1 dimensional vector arrays.

4. You must use the appropriate libraries in writing this program.

5. Must properly format the output by use the appropriate library. See the output below

. Also , Replace my first / last name with your own first / last name.

6. You must use the following file names :

• 3358_0_LastName_FirstName_PG2.cpp

• 3358_1_LastName_FirstName_PG2.cpp

• 3358_2_LastName_FirstName_PG2.cpp

( Section 0 )

( Section 1 )

( Section 2 )

Where LastName is your Last Name and FirstName is your First Name. For example ,

the file name should look something like :

3358_0_Gholoom_Husain_PG2.cpp ( not .cbp )




You must upload your programs no later than the starting of class time on the due date.

No late assignments will be accepted.

Use TRACS to upload your program

8. You must also turn in hard copy of your source code no later than the due date / time

. Should the hard copy consist of more than one page , then , the hard copy must be

stapled. if you are unable to turn in a printout during class, you can take the program

to the computer science department and hand it to the front desk personal (Comal 211

) before the deadline. Make sure that the front office stamps the program. Make sure

that include the date and time. Finally ,make sure that they place the program in my

mailbox.

DO NOT slide your program under my office door – It will NOT be accepted

The following points will be deducted if :

• Compilation Errors , Incorrect file format such as uploading .cbp instead of

.cpp , missing electronic copy , missing the hardcopy , using .h and .cpp

files

( - 10 points )

• Logical Errors ( at least - .75 point )

• Other ( at least .5 points )













if any of the following takes a place :

Unable to read the source code due to unclear printing

Not using class definition , missing vector arrays or switch

statements .. etc.

Incorrect Output format.

Incorrect program file name.

Hard copy is not stapled.

Incorrect Style such as but not limited to Missing Headers ,

Footers , Comments or Program Documentations , Missing roster

number , missing section number ... etc.




Sample Run

Welcome to My Grades APP.

1.

2.

3.

4.

5.

6.

7.

9.

Set A Programming Assignment Grade

Set A Test Grade

Show All Programming Assignment Grades

Show All Test Grades

Show Overall Grades

Delete A Programming Assignment Grades

Delete A Test Grade

Exit The Program

Enter your choice

---

D

Error *** Incorrect input - You entered a character

Enter a Positive Integer

1.

2.

3.

4.

5.

6.

7.

9.

Set A Programming Assignment Grade

Set A Test Grade

Show All Programming Assignment Grades

Show All Test Grades

Show Overall Grades

Delete A Programming Assignment Grades

Delete A Test Grade

Exit The Program

Enter your choice

Error ***

1.

2.

3.

4.

5.

6.

7.

9.

---

8

You entered invalid choice

Set A Programming Assignment Grade

Set A Test Grade

Show All Programming Assignment Grades

Show All Test Grades

Show Overall Grades

Delete A Programming Assignment Grades

Delete A Test Grade

Exit The Program

Enter your choice

---

X

Error *** Incorrect input - You entered a character

Enter a Positive Integer

More products