// Lab3-Ansari.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include using namespace std; int main() { int numAssignments; int avgNum = 0; int Assignment; cout << "Please enter the number of assignments in the class: "; cin >> numAssignments; if (numAssignments > 0) { for (int i = 0; i < numAssignments; i++) { cout << "Please enter assignment score: "; cin >> Assignment; avgNum += Assignment; } cout << endl; cout << "The average of the assignments is: "; cout << (float)avgNum / numAssignments; } else { cout << "Insufficient number of assignments"; } } //int a = 0; //cout << a++ << endl; //cout << ++a << endl; //cout << a + 1 << endl; //cout << a << endl; //cout << --a << endl; /* int money; cout << "Please enter how much money is in your account: "; cin >> money; cout << endl; int accnt_num; cout << "Please enter how many types of accounts you own: "; cin >> accnt_num; cout << endl; string level; if (money >= 25000) { level = "Platinum"; } else if (money >= 10000 && accnt_num == 2) { level = "Gold"; } else if (money >= 10000 && accnt_num == 1) { level = "Silver"; } else { level = "Copper"; } cout << level; short guess; cout << "ENter a number between 0 and 4: "; cin >> guess; switch (guess) { case 0: cout << "Zero" << endl; break; case 1: cout << "One" << endl; break; case 2: cout << "Two" << endl; break; case 3: cout << "Three" << endl; break; case 4: cout << "Four" << endl; break; default: cout << "Invalid guess entered."; } float loanAmount; float interestRate; float amountDue; cout << "Enter requested loan amount: "; cin >> loanAmount; cout << endl; cout << "Enter interest rate: "; cin >> interestRate; cout << endl; amountDue = loanAmount * (interestRate / 100); if ((loanAmount >= 100 && loanAmount <= 1000) && (interestRate >= 1 && interestRate <= 18)) { if (loanAmount <= 500) { amountDue += 20; cout << "Loan requested: " << loanAmount << ", Interest rate: " << interestRate << endl; cout << "Total Amount over loan due: " << amountDue; } else { amountDue += 25; cout << "Loan requested: " << loanAmount << ", Interest rate: " << interestRate << endl; cout << "Total Amount over loan due: " << amountDue; } } else { cout << "INVALID"; } */ // 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