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
22 changes: 22 additions & 0 deletions Lab01_#1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// ConsoleApplication7.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
int main()
{
string food1 = "";
string food2 = "";

cout << "What is one of your favorite foods? ";
cin >> food1;
cout << "What is another one of your favorite foods? ";
cin >> food2;
cout << "Your new favorite food is " << food1 << food2 << endl;

getchar();
getchar();
return 0;
}
27 changes: 27 additions & 0 deletions Lab01_#2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// ConsoleApplication8.cpp : Defines the entry point for the console application.
//
/*****************************************************
* Problem2.cpp *
* Author: Sam Coon *
* Date: 1/20/15 *
*****************************************************/
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
double bill = 0.0;
double tip = 0.0;
float percent = .15;

cout << "\tWelcome to tip calculator!" << endl;
cout << "Enter the cost of the bill: ";
cin >> bill;
tip = bill*percent;
cout << "Your tip should be $" << tip << endl;

getchar();
getchar();
return 0;
}

33 changes: 33 additions & 0 deletions Lab01_#3.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// ConsoleApplication9.cpp : Defines the entry point for the console application.
//
/**************************************
* Problem3.cpp *
* Author: Sam Coon *
* Date: 1/21/15 *
**************************************/

#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
double total = 0.0;
double car = 0.0;
double tax = 0.0;
double liscense = 0.0;
int dealerPrep = 300;
int locationCharge = 200;

cout << "\tCar Salesman Program" << endl;
cout << "Enter the price of the car you want: ";
cin >> car;
tax = .15 * car;
liscense = .2 * car;
total = car + tax + liscense + dealerPrep + locationCharge;
cout << "The total of the car after all additional fees is $" << total << endl;

getchar();
getchar();
return 0;
}

42 changes: 42 additions & 0 deletions Lab01_#4.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// ConsoleApplication10.cpp : Defines the entry point for the console application.
//
/**********************************************************************
* Problem4.cpp *
* Author: Sam Coon *
* Date: 1/21/15 *
* Include iostream, stdlib.h, and time.h *
* using namespace std *
* int main() *
* Set number to a random number 1-5 *
* set up an if statement with a different fortune for every number *
**********************************************************************/
#include "stdafx.h"
#include <iostream>
#include "stdlib.h"
#include "time.h"
using namespace std;
int main()
{
srand(time(0));
int number = rand() % 5 + 1;

if(number == 1){
cout << "You will fall down the stairs soon." << endl;
}
else if(number == 2){
cout << "You will run into a door today." << endl;
}
else if(number == 3){
cout << "You will come across some money today." << endl;
}
else if(number == 4){
cout << "The cake is a lie." << endl;
}
else if (number == 5){
cout << "Be careful where you go." << endl;
}

getchar();
return 0;
}