Skip to content

Instantly share code, notes, and snippets.

@Newtochr

Newtochr/P3 Secret

Created April 16, 2020 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Newtochr/d5223a4bf54e748bd32f3031377889a9 to your computer and use it in GitHub Desktop.
Save Newtochr/d5223a4bf54e748bd32f3031377889a9 to your computer and use it in GitHub Desktop.
Old version
#include "stdafx.h"
#include <iostream> // I/O operations
#include <iomanip> // Formatting functions
#include <cstdlib> // General use library functions
#include <string> // Defines dynamic string stuff
using namespace std;
int main()
{
// Variable and object creation
string csid = "XXXX";
string first = "XXXX";
string last = "XXXX";
string grade1 = "XXXX";
string grade2 = "XXXX";
string grade3 = "XXXX";
string grade4 = "XXXX";
string grade5 = "XXXX";
string grade6 = "XXXX";
char letterGrade = 'A';
double grade1_num = atof(grade1.c_str());
double grade2_num = atof(grade2.c_str());
double grade3_num = atof(grade3.c_str());
double grade4_num = atof(grade4.c_str());
double grade5_num = atof(grade5.c_str());
double grade6_num = atof(grade6.c_str());
// Transition screen variable
string resp = "XXXX";
// End of variable declarations ----------------------------------------------
// Beginning of the Splash Screen --------------------------------------------
system("cls"); //Calls to the OS using cls function MS specific
cout << R"(
_______ _______ _______ ______ _______ _______
| | | | |______ | ____ | |______
| | | |_____ ______| |_____| | ______|
_
-=\`\
|\ ____\_\__
-=\c`""""""" "`)
`~~~~~/ /~~`---
-==/ /
'-'
_ _
( ` )_
( ) `) _ _
(_ (_ . _) _) ( ` )_
( ) ( _) _)
( ` ) . )
(_, _( ,_)_)
Miramar College
STUDENT GRADE TRACKING SYSTEM
Programmed By: Christopher Newton
Rev 1.0 - 2/16/2020
)" << endl;
// End of the Splash Screen --------------------------------------------------
// Transition to next screen
cout << " Press <ENTER> to Continue";
getline(cin, resp);
system("cls");
// End of transition
// Start of Input Screen -----------------------------------------------------
cout << endl;
cout << " Miramar College" << endl;
cout << " STUDENT GRADE TRACKING SYSTEM" << endl;
cout << " ( Input Screen )" << endl;
cout << endl;
cout << " ----------------------------------------------------------------------------- " << endl;
cout << endl;
cout << " Please press <ENTER> after inputting data";
cout << endl << endl;
cout << " Last Name: "; getline(cin, last);
cout << " First Name: "; getline(cin, first);
cout << endl;
cout << " Student ID Number (10-Digit): "; getline(cin, csid);
cout << endl;
cout << " ----------------------------------------------------------------------------- " << endl;
cout << endl;
cout << " Grade 1: "; getline(cin, grade1);
cout << " Grade 2: "; getline(cin, grade2);
cout << " Grade 3: "; getline(cin, grade3);
cout << " Grade 4: "; getline(cin, grade4);
cout << " Grade 5: "; getline(cin, grade5);
cout << " Grade 6: "; getline(cin, grade6);
cout << endl;
cout << endl;
// End of the Input Screen ---------------------------------------------------
// Transition to next screen
cout << " Press <ENTER> to Continue";
getline(cin, resp);
system("cls");
// End of transition
// Conversions, Decisions and Calculations
double Average = (grade1_num + grade2_num + grade3_num + grade4_num + grade5_num + grade6_num) / 6.0;
{
if (Average > 100)
letterGrade = '+';
else
if (Average >= 90)
letterGrade = 'A';
else
if (Average >= 80)
letterGrade = 'B';
else
if (Average >= 70)
letterGrade = 'C';
else
if (Average >= 60)
letterGrade = 'D';
else
if (Average >= 50)
letterGrade = 'E';
else
if (Average >= 0)
letterGrade = 'F';
else
letterGrade = '-';
}
// Start of Output Screen ----------------------------------------------------
cout << endl;
cout << " Miramar College" << endl;
cout << " STUDENT GRADE TRACKING SYSTEM" << endl;
cout << " ( Output Screen )" << endl;
cout << R"(
90 - 100 -> A
80 - 90 -> B
70 - 80 -> C
60 - 70 -> D
50 - 60 -> E
less than 50 -> F
----------------------------------
)";
cout << " Student Name (Last, First): " << last;
cout << " " << first << endl;
cout << " CSID: " << csid << endl;
cout << endl;
cout << " Grade 1: " << grade1 << endl;
cout << " Grade 2: " << grade2 << endl;
cout << " Grade 3: " << grade3 << endl;
cout << " Grade 4: " << grade4 << endl;
cout << " Grade 5: " << grade5 << endl;
cout << " Grade 6: " << grade6 << endl;
cout << endl;
cout << " Total Grade Average: " << Average;
cout << " Letter Grade: " << letterGrade << endl;
if (Average > 100) {
letterGrade = '+';
cout << " Error: Grade cannot be more than 100";
}
if (Average < 0) {
letterGrade = '-';
cout << " Error: Grade cannot be less than 0";
}
cout << endl;
// End of the Output Screen --------------------------------------------------
// Transition to next screen
cout << " Press <ENTER> to Continue";
getline(cin, resp);
system("cls");
// End of transition
return 0;
}// int main( )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment