aboutsummaryrefslogtreecommitdiff
path: root/CST116F2021-Lab3/CST116F2021-Lab3.cpp
diff options
context:
space:
mode:
authorWiserJ <[email protected]>2021-10-13 16:14:36 -0700
committerWiserJ <[email protected]>2021-10-13 16:14:36 -0700
commitbd09725b48865821de506419fd964c0372554e0c (patch)
tree55751250ca7aab8403eac3b18ec0de08bbc84876 /CST116F2021-Lab3/CST116F2021-Lab3.cpp
parentAdd online IDE url (diff)
downloadcst116-lab3-jeffwoit-bd09725b48865821de506419fd964c0372554e0c.tar.xz
cst116-lab3-jeffwoit-bd09725b48865821de506419fd964c0372554e0c.zip
a
Diffstat (limited to 'CST116F2021-Lab3/CST116F2021-Lab3.cpp')
-rw-r--r--CST116F2021-Lab3/CST116F2021-Lab3.cpp122
1 files changed, 109 insertions, 13 deletions
diff --git a/CST116F2021-Lab3/CST116F2021-Lab3.cpp b/CST116F2021-Lab3/CST116F2021-Lab3.cpp
index 41af613..1743e86 100644
--- a/CST116F2021-Lab3/CST116F2021-Lab3.cpp
+++ b/CST116F2021-Lab3/CST116F2021-Lab3.cpp
@@ -2,19 +2,115 @@
//
#include <iostream>
+#include <iomanip>
+using namespace std;
int main()
{
- std::cout << "Hello World!\n";
-}
-
-// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
-// Debug program: F5 or Debug > Start Debugging menu
-
-// Tips for Getting Started:
-// 1. Use the Solution Explorer window to add/manage files
-// 2. Use the Team Explorer window to connect to source control
-// 3. Use the Output window to see build output and other messages
-// 4. Use the Error List window to view errors
-// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
-// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
+ //p.168
+ //1. Take a loan within the correct bounds and calculate the interest and fees.
+ //2. Program takes 2 inputs, loan and interest rate. Loan can only be between 100 and 1000 dollars and between 1 and 18% interest rate. Display an error otherwise and end the program. Determine loan fees based on the loan amount. Calculate the interest and display loan, interest rate, and sum of the interest and fees.
+ //3.?
+ //4.
+ /*1. Define loan, interest rate, interest value, fees, and sum
+ * 2. Accept user inputs for loan and interest rate values
+ 3. Compare loan and interest rate to set range
+ If not within range, output an error and end.
+ 4. Compare loan to a range that determines the fees
+ 5. Calculate the interest on the loan.
+ 6. Print Loan, Interest Rate, and the sum of the interest and fees.*/
+
+ int loan = 0;
+ float rate = 0;
+ float interest = 0;
+ int fees = 0;
+ float sum = 0;
+
+ cout <<
+
+
+
+
+
+
+
+
+
+
+ //p.161
+ /* int menu = 0;
+
+ cout << setw(38) << "Student Grade Program\n"
+ << setw(35) << "- Main Menu -\n\n"
+ << setw(27) << "1. Enter Name\n"
+ << setw(34) << "2. Enter test scores\n"
+ << setw(36) << "3. Display test scores\n"
+ << setw(22) << "9. Exit\n\n"
+ << setw(52) << "Please enter your choice from the list above: ";
+ cin >> menu;
+
+ switch (menu)
+ {
+ case 1:
+ cout << "\tYou have selected \"Enter name\"\n";
+ break;
+ case 2:
+ cout << "\tYou have selected \"Enter test scores\"\n";
+ break;
+ case 3:
+ cout << "\tYou have selected \"Display test scores\"\n";
+ break;
+ case 9:
+ cout << "\tYou have chosen to exit the program.\n";
+ break;
+ default:
+ cout << "\tInvalid selection.\n";
+ }
+
+ return 0;*/
+
+
+
+
+
+ //p.155
+ //int account = 0;
+ //float balance = 0;
+
+ //while (account != 1 && account != 2 && account != 3)
+ //{
+ // cout << "Enter 1 for Checking, 2 for Savings, or 3 for both: ";
+ // cin >> account;
+
+ // if (account == 1)
+ // cout << "You have a Checking account.";
+ // else if (account == 2)
+ // cout << "You have a Savings account.";
+ // else if (account == 3)
+ // cout << "You have both a Checking and Savings account.";
+ // else
+ // cout << "Error. Please enter a valid account type.";
+ //}
+
+ //cout << "\nPlease enter account balance: ";
+ //cin >> balance;
+
+ //if (balance >= 25000 && account == 3)
+ // cout << "You have a Platinum membership for Checking and Savings.";
+ //else if (balance < 25000 && balance >= 10000 && account == 3)
+ // cout << "You have a Gold membership for Checking and Savings.";
+ //else if (balance > 10000 && account != 3)
+ // if (account == 1)
+ // cout << "You have a Silver membership on a Checking account.";
+ // else
+ // cout << "You have a Silver membership on a Savings account.";
+ //else
+ // if (account == 1)
+ // cout << "You have a Copper membership on a Checking account.";
+ // else
+ // cout << "You have a Copper membership on a Savings account.";
+ //
+ //cout << "\n";
+
+ //return 0;
+} \ No newline at end of file