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 @@
// ConsoleApplication7.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}

#include <string>
#include <iostream>
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;
}
25 changes: 25 additions & 0 deletions Lab01_2.cpp
Original file line number Diff line number Diff line change
@@ -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 <iostream>
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;
}

28 changes: 28 additions & 0 deletions Lab01_3.cpp
Original file line number Diff line number Diff line change
@@ -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 <iostream>
#include <string>
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;
}
33 changes: 33 additions & 0 deletions Lab01_4.cpp
Original file line number Diff line number Diff line change
@@ -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 <iostream>
#include <string>
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;
}