diff options
| author | Benjamin Schroeder <[email protected]> | 2021-10-13 19:10:14 -0700 |
|---|---|---|
| committer | Benjamin Schroeder <[email protected]> | 2021-10-13 19:10:14 -0700 |
| commit | c604880b7bf87bac6fbc6ebb0bbe31c1c3229bf0 (patch) | |
| tree | 0dda2fa4131e7257db3e2331b7016d5b6040d852 /CST116F2021-Lab3 | |
| parent | Runs text file added (diff) | |
| download | cst116-lab3-bensprogramma-c604880b7bf87bac6fbc6ebb0bbe31c1c3229bf0.tar.xz cst116-lab3-bensprogramma-c604880b7bf87bac6fbc6ebb0bbe31c1c3229bf0.zip | |
Runs From Lab3.txt
Diffstat (limited to 'CST116F2021-Lab3')
| -rw-r--r-- | CST116F2021-Lab3/CST116F2021-Lab3.cpp | 190 | ||||
| -rw-r--r-- | CST116F2021-Lab3/Runs From Lab3.txt | 97 |
2 files changed, 186 insertions, 101 deletions
diff --git a/CST116F2021-Lab3/CST116F2021-Lab3.cpp b/CST116F2021-Lab3/CST116F2021-Lab3.cpp index 530d182..a0e6e03 100644 --- a/CST116F2021-Lab3/CST116F2021-Lab3.cpp +++ b/CST116F2021-Lab3/CST116F2021-Lab3.cpp @@ -7,31 +7,19 @@ using namespace std; int main() { - // p126 6.4 + ////6.4 p126 -// int a = 0; -// cout << a++ << endl; -// cout << ++a << endl; -// cout << a + 1 << endl; -// cout << a << endl; -// cout << --a << endl; + // int a = 0; + // cout << a++ << endl; + // cout << ++a << endl; + // cout << a + 1 << endl; + // cout << a << endl; + // cout << --a << endl; -//// p126 6.5 -// -// int a = 10; -// int b = 20; -// int c = 30; -// -// cout << a += 25 << endl; -// cout << b *= (a * 2) << endl; -// cout << b += 1 << endl; -// cout << c %= 5 << endl; -// cout << b /= a << endl; -// -//// p148 7.1 1 thru 4' +//// p148 7.1 1 thru 6 // // int int_exp1 = 0; // int int_exp2 = 1; @@ -46,23 +34,8 @@ int main() // // p155 7.2 bank level of membership program - /*Pseudo - code for grading(p. 153) : - - Enter Student_Score - IF Student_Score >= 90 - Display �A� - Exit - ELSE IF Student_Score >= 80 - Display �B� - Exit - ELSE IF Student_Score >= 70 - Display �C� - Exit - ELSE IF Student_Score >= 60 - Display �D� - - ?Exit - Display �E�*/ + + /*int numAccounts; float Amount; @@ -74,46 +47,62 @@ int main() cout << "\t\tBank Membership Staus\n"; cout << "How many accounts does the member have? (1 or 2): "; cin >> numAccounts; - cout << "\nEnter total amount the member has in all accounts: "; + cout << "\nEnter total amount the member has in all accounts (dollars): "; cin >> Amount; - if ()*/ - - + if (Amount >= 25000) + { + cout << "\nPlatinum Member\n\n"; + } + else if (Amount > 10000 && Amount <=25000 && numAccounts == 2) + { + cout << "\nGold Member\n\n"; + } + else if (Amount > 10000 && numAccounts == 1) + { + cout << "\nSilver Member\n\n"; + } + else + + cout << "\nCopper Member\n\n";*/ + - //// p161 7.4 #1 case statement - // short choice; - // cout << "\t Student Grade Program\n"; - // cout << "\t\t -Main Menu-\n\n"; - // cout << "\t1. Enter name\n"; - // cout << "\t2. Enter test scores\n"; - // cout << "\t3. Display test scores\n"; - // cout << "\t4. Exit\n\n"; - // cout << "Please enter your choice from the list above: "; - // cin >> choice; - // switch (choice) - // { - // case 1: - // cout << "Enter name"<< endl; - // break; - // case 2: - // cout << "Enter test scores" << endl; - // break; - // case 3: - // cout << "Display test scores" << endl; - // break; - // case 4: - // cout << "Exit" << endl; - // break; - // default: - // cout << "Invalid Choice" << endl; + //// p161 7.4 #1 case statement + short choice; + + cout << "\t Student Grade Program\n"; + cout << "\t\t -Main Menu-\n\n"; + cout << "\t1. Enter name\n"; + cout << "\t2. Enter test scores\n"; + cout << "\t3. Display test scores\n"; + cout << "\t4. Exit\n\n"; + cout << "Please enter your choice from the list above: "; + cin >> choice; + + switch (choice) + { + case 1: + cout << "Enter name" << endl; + break; + case 2: + cout << "Enter test scores" << endl; + break; + case 3: + cout << "Display test scores" << endl; + break; + case 4: + cout << "Exit" << endl; + break; + default: + cout << "Invalid Choice" << endl; + } - // return 0; + return 0; @@ -144,38 +133,38 @@ int main() disp interest disp intpaid+fees */ - float amount; - float intRate; - int fees; - float intPaid; - - cout << "Enter amount of loan requested (between $100 and $1000): "; - cin >> amount; - if (amount >= 100 && amount <= 1000) - { - cout << "Enter interest Rate between 1 and 18 %: "; - cin >> intRate; - if (intRate >= 1 && intRate <= 18) - { - if (amount <= 500) - { - fees = 20; - } - else - fees = 25; - - - intPaid = amount * intRate/100; - cout << "\nLoan requested: $" << amount; - cout << "\nInterest Rate: " << intRate << "%"; - cout << "\nInterest and fees: $" << fees+intPaid<<"\n"; - } - else cout << "<You have entered an invalid interest rate>"; - } - - else cout << "<You have entered an invaled loan amount>"; - - + //float amount; + //float intRate; + //int fees; + //float intPaid; + + //cout << "Enter amount of loan requested (between $100 and $1000): "; + //cin >> amount; + //if (amount >= 100 && amount <= 1000) + //{ + // cout << "Enter interest Rate between 1 and 18 %: "; + // cin >> intRate; + // if (intRate >= 1 && intRate <= 18) + // { + // if (amount <= 500) + // { + // fees = 20; + // } + // else + // fees = 25; + + + // intPaid = amount * intRate/100; + // cout << "\nLoan requested: $" << amount; + // cout << "\nInterest Rate: " << intRate << "%"; + // cout << "\nInterest and fees: $" << fees+intPaid<<"\n"; + // } + // else cout << "<You have entered an invalid interest rate>"; + //} + // + //else cout << "<You have entered an invaled loan amount>"; + // + // @@ -202,3 +191,4 @@ int main() } + diff --git a/CST116F2021-Lab3/Runs From Lab3.txt b/CST116F2021-Lab3/Runs From Lab3.txt index 18fbc61..cab4401 100644 --- a/CST116F2021-Lab3/Runs From Lab3.txt +++ b/CST116F2021-Lab3/Runs From Lab3.txt @@ -1,4 +1,96 @@ -Run from 7.10_2 +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +Output from 6.4 p126 + +0 +2 +3 +2 +1 + +C:\Users\Lenovo\Source\Repos\cst116-lab3-BensProgramma\x64\Debug\CST116F2021-Lab3.exe (process 17068) exited with code 0. +To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. +Press any key to close this window . . . + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +Corrections from 7.1 1 thru 6 p148 +// +// int int_exp1 = 0; +// int int_exp2 = 1; +// char char_exp = 'B'; +// +// int_exp1 >= int_exp2; // put great than sign before = to correct it +// int_exp1 == int_exp2; // made it a == sign +// int_exp1 != int_exp2; // explamation should be before = +// char_exp == 'A'; // should have single quote for char +// int_exp1 > char_exp; // trying to compare an int to a char +// int_exp1 < 2 && int_exp1 > -10 // needs to nhave the variable in the second comparison +// + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +Run from 7.2_1 p155 (several runs) + +(run 1) + +Bank Membership Staus +How many accounts does the member have? (1 or 2): 2 + +Enter total amount the member has in all accounts (dollars): 9000 + +Copper Member + + +C:\Users\Lenovo\Source\Repos\cst116-lab3-BensProgramma\x64\Debug\CST116F2021-Lab3.exe (process 9592) exited with code 0. +To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. +Press any key to close this window . . . + +(run 2) + Bank Membership Staus +How many accounts does the member have? (1 or 2): 1 + +Enter total amount the member has in all accounts (dollars): 45000 + +Platinum Member + + +C:\Users\Lenovo\Source\Repos\cst116-lab3-BensProgramma\x64\Debug\CST116F2021-Lab3.exe (process 11708) exited with code 0. +To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. +Press any key to close this window . . . + + (run3) + Bank Membership Staus +How many accounts does the member have? (1 or 2): 2 + +Enter total amount the member has in all accounts (dollars): 12000 + +Gold Member + + +C:\Users\Lenovo\Source\Repos\cst116-lab3-BensProgramma\x64\Debug\CST116F2021-Lab3.exe (process 4268) exited with code 0. +To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. +Press any key to close this window . . . + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +Run from 7.4_1 p161 + + Student Grade Program + -Main Menu- + + 1. Enter name + 2. Enter test scores + 3. Display test scores + 4. Exit + +Please enter your choice from the list above: 2 +Enter test scores + +C:\Users\Lenovo\Source\Repos\cst116-lab3-BensProgramma\x64\Debug\CST116F2021-Lab3.exe (process 2840) exited with code 0. +To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. +Press any key to close this window . . . + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +Run from 7.10_2 p168 Enter amount of loan requested (between $100 and $1000): 250 @@ -11,3 +103,6 @@ Interest and fees: $26.25 C:\Users\Lenovo\Source\Repos\cst116-lab3-BensProgramma\x64\Debug\CST116F2021-Lab3.exe (process 5524) exited with code 0. To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. Press any key to close this window . . . + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
\ No newline at end of file |