diff options
| author | Benjamin Schroeder <[email protected]> | 2021-10-13 19:41:51 -0700 |
|---|---|---|
| committer | Benjamin Schroeder <[email protected]> | 2021-10-13 19:41:51 -0700 |
| commit | feda0c0668ccc3a463e7c1dc6c38ab4e62d23265 (patch) | |
| tree | 7481da81732b58d83429be3a32c02bb3b80583a3 /CST116F2021-Lab3 | |
| parent | Runs From Lab3.txt (diff) | |
| download | cst116-lab3-bensprogramma-feda0c0668ccc3a463e7c1dc6c38ab4e62d23265.tar.xz cst116-lab3-bensprogramma-feda0c0668ccc3a463e7c1dc6c38ab4e62d23265.zip | |
Runs from Lab3
Diffstat (limited to 'CST116F2021-Lab3')
| -rw-r--r-- | CST116F2021-Lab3/CST116F2021-Lab3.cpp | 172 | ||||
| -rw-r--r-- | CST116F2021-Lab3/Runs From Lab3.txt | 22 |
2 files changed, 126 insertions, 68 deletions
diff --git a/CST116F2021-Lab3/CST116F2021-Lab3.cpp b/CST116F2021-Lab3/CST116F2021-Lab3.cpp index a0e6e03..a1f02d4 100644 --- a/CST116F2021-Lab3/CST116F2021-Lab3.cpp +++ b/CST116F2021-Lab3/CST116F2021-Lab3.cpp @@ -7,37 +7,40 @@ using namespace std; int main() { - ////6.4 p126 +/* //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + 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; +*/ -//// p148 7.1 1 thru 6 -// -// 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 -// +/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + p148 7.1 1 thru 6 -// p155 7.2 bank level of membership program + 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 +*/ +/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + p155 7.2 bank level of membership program - /*int numAccounts; + int numAccounts; float Amount; double plat; double gold; @@ -63,8 +66,8 @@ int main() cout << "\nSilver Member\n\n"; } else - - cout << "\nCopper Member\n\n";*/ + cout << "\nCopper Member\n\n"; +*/ @@ -72,8 +75,9 @@ int main() - //// p161 7.4 #1 case statement - short choice; +/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + p161 7.4 #1 case statement + /*short choice; cout << "\t Student Grade Program\n"; cout << "\t\t -Main Menu-\n\n"; @@ -103,18 +107,20 @@ int main() } return 0; +*/ +/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + 7.10 #2 p168 problem solving steps - // p168 7.10 #2 problem solving steps - /* Problem: Legitimize loans + Problem: Legitimize loans Understand Problem: Firstly the loan request and interest need to be validated Secondly the appropriate fees need to be assigned - thirdly display the pertenent info about the loan + thirdly display the pertinent info about the loan Psuedo code: 1) get loan amount 2) check to see if the loan amount falls between $100 and $1000 @@ -131,55 +137,87 @@ int main() 7) Display output disp amount 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>"; - // - // + disp intpaid+fees */ +/* // Actual Code: + + 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>"; +*/ + +/* //////////////////////////////////////////////////////////////////////////////////////////////////////////////// + 6.5 (1 thru 5) p126 + + int a = 10; + int b = 20; + int c = 30; + ` //(Converted expressions) + a += 25; + b *= (a*2) + b += 1 + c %= 5 + b /= a + +*/ +/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + 8.2_1 p177 +*/ +/* ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + 8.3_1 p179 +*/ +/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + 8.4_1 p184 +*/ +/* ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + 8.10_3 p192 +*/ + + + + + + + + @@ -190,5 +228,11 @@ int main() + + + + + + return 0; } diff --git a/CST116F2021-Lab3/Runs From Lab3.txt b/CST116F2021-Lab3/Runs From Lab3.txt index cab4401..02f1066 100644 --- a/CST116F2021-Lab3/Runs From Lab3.txt +++ b/CST116F2021-Lab3/Runs From Lab3.txt @@ -30,8 +30,7 @@ Corrections from 7.1 1 thru 6 p148 Run from 7.2_1 p155 (several runs) (run 1) - -Bank Membership Staus + 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 @@ -43,6 +42,7 @@ C:\Users\Lenovo\Source\Repos\cst116-lab3-BensProgramma\x64\Debug\CST116F2021-Lab 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 @@ -55,8 +55,9 @@ 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) +(run3) Bank Membership Staus How many accounts does the member have? (1 or 2): 2 @@ -105,4 +106,17 @@ To automatically close the console when debugging stops, enable Tools->Options-> Press any key to close this window . . . -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
\ No newline at end of file +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +Run from 8.2_1 p177 + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +Run from 8.3_1 p179 + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +Run from 8.4_1 p184 + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +Run from 8.10_3 p192
\ No newline at end of file |