diff --git a/Lab01_1.cpp b/Lab01_1.cpp new file mode 100644 index 0000000..bc8893d --- /dev/null +++ b/Lab01_1.cpp @@ -0,0 +1,24 @@ +// ConsoleApplication7.cpp : Defines the entry point for the console application. +// + +#include "stdafx.h" + + +int _tmain(int argc, _TCHAR* argv[]) +{ + return 0; +} + +#include +#include +using namespace std; +int main(void){ + string favFood1; + cout << "What is your favorite food? "; + getline(cin, favFood1); + string favFood2; + cout << "What is your second favorite food? "; + getline(cin, favFood2); + cout << "Your new food is: " << favFood1 << " " << favFood2; + return 0; +} diff --git a/Lab01_2.cpp b/Lab01_2.cpp new file mode 100644 index 0000000..c705359 --- /dev/null +++ b/Lab01_2.cpp @@ -0,0 +1,25 @@ +// ConsoleApplication10.cpp : Defines the entry point for the console application. +// + +#include "stdafx.h" + + +int _tmain(int argc, _TCHAR* argv[]) +{ + return 0; +} + +#include +using namespace std; +int main(){ + float tipTotal; + cout << "How much is the bill total? "; + cin >> tipTotal; + float tipOne = tipTotal * 0.15; + float tipTwo = tipTotal * 0.20; + cout << "A 15% tip would be: " << tipOne << + " A 20% tip would be: " << tipTwo << endl; + system("pause"); + return 0; +} + diff --git a/Lab01_3.cpp b/Lab01_3.cpp new file mode 100644 index 0000000..675baa8 --- /dev/null +++ b/Lab01_3.cpp @@ -0,0 +1,28 @@ +// ConsoleApplication11.cpp : Defines the entry point for the console application. +// + +#include "stdafx.h" + + +int _tmain(int argc, _TCHAR* argv[]) +{ + return 0; +} +#include +#include +using namespace std; +int main(){ + float mynumber; + float basePrice; + cout << "What is the base price of the car? "; + cin >> basePrice; + float tax = .50 * basePrice; + float license = .30 * basePrice; + float dealerPrep = 70.00; + float destinationCharge = 40.00; + float totalPrice = tax + license + dealerPrep + destinationCharge + basePrice; + cout << "Your total price for the car comes out to: " << totalPrice << " dollars."; + getchar(); + cin.get(); + return 0; +} diff --git a/Lab01_4.cpp b/Lab01_4.cpp new file mode 100644 index 0000000..ec2ed76 --- /dev/null +++ b/Lab01_4.cpp @@ -0,0 +1,33 @@ +// ConsoleApplication14.cpp : Defines the entry point for the console application. +// + +#include "stdafx.h" + + +int _tmain(int argc, _TCHAR* argv[]) +{ + return 0; +} +#include +#include +using namespace std; +int main(){ + int number = rand() % 5 + 1; + if (number == 1){ + cout << "Your future is looking very bright!" << endl; + } + else if (number == 2){ + cout << "You might want to re-evaluate your latest life choice." << endl; + } + else if (number == 3){ + cout << "Your greatest quality will soon be revealed." << endl; + } + else if (number == 4){ + cout << "Keep your loved ones close, they know best." << endl; + } + else if (number == 5){ + cout << "Your attitude towards life could use an adjustment." << endl; + } + getchar(); + return 0; +}