From d143904c1df6fee0abda6154cc9b1929613b63e7 Mon Sep 17 00:00:00 2001 From: Mark B Date: Sat, 24 Jul 2021 11:41:20 -0400 Subject: [PATCH] added a number that it likes --- TO-DO.md | 2 +- src/main.cpp | 51 ++++++++++++++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/TO-DO.md b/TO-DO.md index 56169ca..bd2f9a4 100644 --- a/TO-DO.md +++ b/TO-DO.md @@ -1 +1 @@ -Learn stuffies +add a file that has the number that someone typed aswell as their name diff --git a/src/main.cpp b/src/main.cpp index 002d82e..152e923 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,23 +1,28 @@ -#include -using namespace std; - -void NumberInput() { - int UsrNum; // this makes a variable - cout << "Type your favorite number will ya: "; - cin >> UsrNum; // this gets checks for user input and loads it into UsrNum - cout << "Ew I hate the number " << UsrNum << endl; // this displays the number in UsrNum and then to go down a line -} - -void PrgEnd() { - string Name; // this makes a string called name - cout << "To exit the program please type your name: "; - cin >> Name; // this gets what you typed - cout << "Thanks for playing: " << Name;// this displays what you type -} - -int main() { - NumberInput(); // this runs the NumberInput function - PrgEnd(); - return 0;// this tells all the functions and code to go back to main aka the start -} - +#include +using namespace std; + +void NumberInput() { + int UsrNum; // this makes a variable + cout << "Type your favorite number will ya: "; + cin >> UsrNum; // this gets checks for user input and loads it into UsrNum + //if the number you typed is 69 then it displays Nice in the command line if not then it says it hates that number + if (UsrNum==69){ + cout << "Nice \n"; + } else { + cout << "Ew I hate the number " << UsrNum << endl; // this displays the number in UsrNum and then to go down a line + } +} + +void PrgEnd() { + string Name; // this makes a string called name + cout << "To exit the program please type your name: "; + cin >> Name; // this gets what you typed + cout << "Thanks for playing: " << Name << endl;// this displays what you type +} + +int main() { + NumberInput(); // this runs the NumberInput function + PrgEnd(); // this runs the PrgEnd function + return 0;// this tells all the functions and code to go back to main aka the start +} +