### Semester GPA program hellpppp!!

I know its alot to ask of someone but can anybody give me a little help on this. im still kinda new at this and i have no clue what im doing on this one. i dont want to have to turn it in blank in 4 hours :(

GPA Program
(Modular Program Design)

For this assignment, you are to again complete the following program for computing a semester GPA. You are to implement each function and procedure to meet the specifications given.

//=======================================================================
// GPA CALCULATION PROGRAM
//=======================================================================
// This program will calculate a new semester GPA and new cumulative GPA for a given
// student. The program is limited to the calculations of semesters involving five or less
// courses. It is also limited to grades of A, B, C, D, and F, that is, it does not handle +/- course
//
// Current semester GPA = (Grade1*Credits1 + ... Grade5*Credits5) / (Credits1 + ... + Credits5)
// New cumulative GPA = (Current_Cumulative_GPA*Earned_Credits +
// Semester_GPA*Total_Semester_Credits) /
// (Earned_Credits + Total_Semester_Credits)
//=======================================================================

//=======================================================================
void WelcomeScreen()
//=======================================================================
// This procedure outputs a welcome message and general instructions to the user.

// Input: none
// Precond: none
// Output: none
// Postcond: none
//-----------------------------------------------------------------------------------------------------------------------------
begin

Println(“Welcome to my semester GPA calculator.”);
Println(“This program will take your given information and calculate the semester GPA for an (x) amount of students”);
Println(“If at any time you wish to stop please press ‘Q’”);

end

//=======================================================================
void GetResponse (char &Response)
//=======================================================================
// This procedure will prompt the user for 'y' or 'n', and returns in the parameter passed.
//
// Input: none
// Precond: none
// Output: Response
// Postcond: Response = 'y' or 'n'.
//------------------------------------------------------------------------------------------------------------------------------
begin

(to complete)

end

//=======================================================================
void GetCurrentSemesterData ( char &Grades[], integer &Credits[])
//=======================================================================
// This procedure will prompt the user for the grades received in the current semester, along
// with the credits for each course.
//
// Input: none
// Precond: none
// Postcond: Grades[i] = one of {A,B,C,D,F} for i = 1..5
// 1 <= Credits[i], for each i = 1..5
//------------------------------------------------------------------------------------------------------------------------------
begin

(to complete)

end

//=======================================================================
void GetAllData (float &Cumulative_GPA, integer &Earned_Credits,
//=======================================================================
// This procedure will prompt the user for their current cumulative GPA and total earned hours
// as part of the calculated GPA, and the grades received in the current semester, along with
// the credits for each course.
//
// Input: none
// Precond: none
// Output: Cumulative_GPA, Earned_Credits, Grades, Credits
// Postcond: 0.0 <= Cumulative_GPA <= 4.0
// 0 <= Earned_Credits, Grades[i] = one of {A,B,C,D,F} for i = 1..5
// 1 <= Credits[i], for i = 1..5
//------------------------------------------------------------------------------------------------------------------------------
begin

(to complete)
end

//======================================================================
integer CalcCurrentSemesterGPA (char Grades[], integer Credits[])
//=======================================================================
// This function will calculate and return the current semester GPA for the grades and credits
// passed.
//
// Precond:
// Output: Cumulative_GPA, Earned_Credits, Grades, Credits.
// Postcond: 0 <= Cumulative_GPA, 0 <= Earned_Credits,
// Grades[i] = one of {A,B,C,D,F} for i = 1..5, 1 <= Credits[i], for i = 1..5
//------------------------------------------------------------------------------------------------------------------------------
begin

(to complete)

end

//=======================================================================
float CalcNewCumulativeGPA (float Current_Cumulative_GPA,
integer Current_Earned_Credits,
float Semester_GPA,
integer Semester_Credits)
//=======================================================================
// PRE and POST conditions (to complete)
//-----------------------------------------------------------------------------------------------------------------------------
begin

(to complete)

end

//=======================================================================
// MAIN
//=======================================================================
begin

// Variable Declarations
integer CourseCredits[5];

float SemesterGPA; // Calculated Current Semester GPA

float CurrentCumulativeGPA; // Current Cumulative GPA (excluding current semester)
integer CurrentEarnedCredits; // Current Earned Credits (excluding current semester)
float NewCumulativeGPA; // New Cumulative GPA (including current semester)

// Display Welcome Screen
(here)

// Get Input Data
(here)

// Calculate Current and New Cumulative GPAs
(here)

//Output Results
println("Based on the information entered, ");
println(“your semester GPA and new cumulative GPA are as follows:");
println("Semester GPA = ", SemesterGPA);
println("Old Cumulative GPA = ", CurrentCumulative_GPA);
println("New Cumulative GPA = ", NewCumulativeGPA);

end

Topic archived. No new replies allowed.