Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Lab01_1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Lab01_1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <string>
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;
}
18 changes: 18 additions & 0 deletions Lab01_2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Lab01_2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
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;
}
23 changes: 23 additions & 0 deletions Lab01_3.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*****************
* Lab01_3.cpp *
* By: Zach Golik *
* Date: 1/20/15 *
*****************/

#include "stdafx.h"
#include <iostream>
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;
}
41 changes: 41 additions & 0 deletions Lab01_4.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*****************
* Lab01_4.cpp *
* By: Zach Golik *
* Date: 1/20/15 *
*****************/

#include "stdafx.h"
#include <iostream>
#include <string>
#include <stdlib.h>
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 <enter> 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;
}