From 3348f1b23be8c55252180ede5ceff51322b79024 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Jan 2015 08:05:07 -0600 Subject: [PATCH] new file: Lab01_1.cpp new file: Lab01_2.cpp new file: Lab01_3.cpp new file: Lab01_4.cpp --- Lab01_1.cpp | 24 ++++++++++++++++++++++++ Lab01_2.cpp | 18 ++++++++++++++++++ Lab01_3.cpp | 23 +++++++++++++++++++++++ Lab01_4.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 Lab01_1.cpp create mode 100644 Lab01_2.cpp create mode 100644 Lab01_3.cpp create mode 100644 Lab01_4.cpp diff --git a/Lab01_1.cpp b/Lab01_1.cpp new file mode 100644 index 0000000..7d5a188 --- /dev/null +++ b/Lab01_1.cpp @@ -0,0 +1,24 @@ +// Lab01_1.cpp : Defines the entry point for the console application. +// + +#include "stdafx.h" +#include +#include +int _tmain(int argc, _TCHAR* argv[]) +{ + return 0; +} + +using namespace std; +int main(void){ + string foodOne; + string foodTwo; + cout << "Please enter one of your favorite foods. "; + getline (cin,foodOne); + cout << "Please enter a different favorite food. "; + getline (cin,foodTwo); + string newFood = foodOne + foodTwo; + cout << "Your new favorite food is " << newFood << "."; + getchar(); + return 0; +} \ No newline at end of file diff --git a/Lab01_2.cpp b/Lab01_2.cpp new file mode 100644 index 0000000..a944cdf --- /dev/null +++ b/Lab01_2.cpp @@ -0,0 +1,18 @@ +// Lab01_2.cpp : Defines the entry point for the console application. +// + +#include "stdafx.h" +#include +using namespace std; + +int _tmain(int argc, _TCHAR* argv[]){ + float bill; + cout << "Enter the restaurant bill: "; + cin >> bill; + float tip15 = (bill * .15); + float tip20 = (bill * .2); + cout << "A 15% tip would be " << tip15 << "."; + cout << "A 20% tip would be " << tip20 << "."; + system("pause"); + return 0; +} diff --git a/Lab01_3.cpp b/Lab01_3.cpp new file mode 100644 index 0000000..9ae850d --- /dev/null +++ b/Lab01_3.cpp @@ -0,0 +1,23 @@ +/***************** +* Lab01_3.cpp * +* By: Zach Golik * +* Date: 1/20/15 * +*****************/ + +#include "stdafx.h" +#include +using namespace std; + +int _tmain(int argc, _TCHAR* argv[]){ + float basePrice; // Price of the car orginaly // + float dealerPrep = 200; // The dealer prep // + float destCharge = 500; // The destination charge // + cout << "Enter the base price of the car: "; + cin >> basePrice; // Users input // + float tax = basePrice * .75; // Tax // + float license = basePrice * .25; // License // + float newPrice = basePrice + tax + license + dealerPrep + destCharge; // New price of the car // + cout << "The actual price of the car is: " << newPrice << "." << endl; + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab01_4.cpp b/Lab01_4.cpp new file mode 100644 index 0000000..c572d38 --- /dev/null +++ b/Lab01_4.cpp @@ -0,0 +1,41 @@ +/***************** +* Lab01_4.cpp * +* By: Zach Golik * +* Date: 1/20/15 * +*****************/ + +#include "stdafx.h" +#include +#include +#include +using namespace std; + +int _tmain(int argc, _TCHAR* argv[]){ + string enter; + cout << "Welcome to the greatness that is..." << endl + << "ZACH GOLIK'S FORTUNE TELLER 2K15!!!!" << endl + << "Type anything and press to read your fortune. "; + cin >> enter; + int fortune = rand() % 5 + 1; + if (fortune == 1){ + cout << "I see wealth in your future." << endl; + } + else if (fortune == 2){ + cout << "I see death in your future." << endl; + } + else if (fortune == 3){ + cout << "You will gain a welcome compainian today." << endl; + } + else if (fortune == 4){ + cout << "You will find a new hobby today that will change your life." << endl; + } + else if (fortune == 5){ + cout << "You'll meet an old friend today." << endl; + } + else{ + cout << "Error!" << endl; + } + getchar(); + system("pause"); + return 0; +} \ No newline at end of file