c++lab6copy

3
5/17/2018 c++lab6copy-slidepdf.com http://slidepdf.com/reader/full/clab6copy 1/3 //****************************************************************************** ************// // Written By: Joshua J Gaither Title: HW4 Class: CSC 125 // Project: \\eccentric\Class\csc125\001\Joshua013\hws\hw4 // Last Updated: 3/7/13 // Created On 2/18/13 // Compiler: Visual Studios Visual C++ Native // Notes: Compile and Execute // Overview: Calculates GPA from previous and current school from hours and qua lity //****************************************************************************** ************// #include <iostream> #include <string> #include <iomanip> #include <fstream> #include <cassert> using namespace std; int main() { string yourName; cout << "Please enter your Full name: "; getline (cin, yourName); cout << "\nWelcome " << yourName << "\n"; string yourAge; cout << "\n Please enter your age in years, using whole numbers: " ; //ask user for age cin >> yourAge; string yourSocial; cout << "\n Please enter your Social Security number, numerically withou t dashes or spaces: "; //ask user for ssn cin >> yourSocial; string yourGender; cout << "\n Please indicate your gender by typing either Male or Female:  "; //ask user for gender cin >> yourGender; string yourOldSchool; cout << "\n Please enter the name of your previous university: " ; //ask user for previous college cin >> yourOldSchool; float yourOldHours(0); //var for previous school hours cout << "\nPlease enter the total number of completed credit hours you a re \n transfering from " << yourOldSchool << " to Missouri State University.\n T his should be a number between 1 and 999: " ; cin >> yourOldHours; float yourOldQuality(0); //var for previous school qualit y pounsigned ints cout << "\nPlease enter your cumulative quality total from " << yourOldS chool << "\nas it appears on your most recent transcript.\n This should be a num ber between 1 and 999: ";

Upload: todd-ward

Post on 02-Nov-2015

217 views

Category:

Documents


0 download

DESCRIPTION

Programming, C++

TRANSCRIPT

//******************************************************************************************//// Written By: Joshua J Gaither Title: HW4Class: CSC 125// Project: \\eccentric\Class\csc125\001\Joshua013\hws\hw4 // Last Updated: 3/7/13// Created On 2/18/13// Compiler: Visual Studios Visual C++ Native// Notes: Compile and Execute// Overview: Calculates GPA from previous and current school from hours and quality//******************************************************************************************//#include #include #include #include #include using namespace std;int main(){string yourName;cout yourOldSchool;float yourOldHours(0); //var for previous school hourscout yourMsuQuality;ofstream myout;myout.open("\\\\eccentric\\Class\\csc125\\001\\Joshua013\\labs\\lab6\\record.txt"); // open file location and create record.txtassert(myout.is_open());//check if file is opencout