From e6297c4fcd583de120d861f3dff1c11486ecc4ec Mon Sep 17 00:00:00 2001 From: Mark B Date: Mon, 12 Jul 2021 10:28:35 -0400 Subject: [PATCH 1/7] added TO-DO.md --- TO-DO.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 TO-DO.md diff --git a/TO-DO.md b/TO-DO.md new file mode 100644 index 0000000..7576140 --- /dev/null +++ b/TO-DO.md @@ -0,0 +1,2 @@ +1. add makefile or a way to generate one +2. add a Build guide From 33d9a70935afee938d775dcef71fdbeba423a5ec Mon Sep 17 00:00:00 2001 From: Mark B Date: Mon, 12 Jul 2021 10:30:53 -0400 Subject: [PATCH 2/7] fixed a typo in TO-DO.md --- TO-DO.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TO-DO.md b/TO-DO.md index 7576140..e5b6e0c 100644 --- a/TO-DO.md +++ b/TO-DO.md @@ -1,2 +1,2 @@ -1. add makefile or a way to generate one +1. add a makefile or a way to generate one 2. add a Build guide From 0aa3c87ae465b41fa4a0708dcf606fea85fd232b Mon Sep 17 00:00:00 2001 From: Mark B Date: Tue, 13 Jul 2021 10:20:43 -0400 Subject: [PATCH 3/7] added a makefile --- Makefile | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9cf18e3 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +soup: main.cpp + g++ main.cpp -o soup From 3c731e9b9c758ca24e12e581c9683235365b0222 Mon Sep 17 00:00:00 2001 From: Mark B Date: Tue, 13 Jul 2021 10:48:29 -0400 Subject: [PATCH 4/7] add a build guide --- .gitignore | 1 - Makefile | 4 ++-- README.md | 13 ++++++++++++- TO-DO.md | 3 +-- main.cpp => src/main.cpp | 0 5 files changed, 15 insertions(+), 6 deletions(-) rename main.cpp => src/main.cpp (100%) diff --git a/.gitignore b/.gitignore index 6bd6746..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +0,0 @@ -log.txt diff --git a/Makefile b/Makefile index 9cf18e3..f5bfa7f 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,2 @@ -soup: main.cpp - g++ main.cpp -o soup +soup: src/main.cpp + g++ src/main.cpp -o soup diff --git a/README.md b/README.md index ebcfaae..40a4584 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,13 @@ -this is just some hello world type C++ code with comments +This is just some hello world type C++ code with comments read below for build instructions + + +*--------Building--------* +Before you can compile the code you will need GNU make and GNU g++. + +This is what you should type in the command line + +1. git clone https://gitdab.com/Canneddonuts/CPP_git_test +2. cd CPP_git_test +3. make + diff --git a/TO-DO.md b/TO-DO.md index e5b6e0c..56169ca 100644 --- a/TO-DO.md +++ b/TO-DO.md @@ -1,2 +1 @@ -1. add a makefile or a way to generate one -2. add a Build guide +Learn stuffies diff --git a/main.cpp b/src/main.cpp similarity index 100% rename from main.cpp rename to src/main.cpp From 3a1b6549fc99a7f0a843f68d4b24de6fdbf496a3 Mon Sep 17 00:00:00 2001 From: Mark B Date: Fri, 16 Jul 2021 11:48:54 -0400 Subject: [PATCH 5/7] removed template code --- Makefile | 4 ++-- README.md | 4 +++- src/main.cpp | 17 ++++++++++++----- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index f5bfa7f..a8dc007 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,2 @@ -soup: src/main.cpp - g++ src/main.cpp -o soup +favnum: src/main.cpp + g++ src/main.cpp -o favnum diff --git a/README.md b/README.md index 40a4584..3b44a42 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -This is just some hello world type C++ code with comments read below for build instructions +Have you ever wanted to know what your PC thinks about your favorite number if so, then this litle C++ program has got you covered. + + *--------Building--------* diff --git a/src/main.cpp b/src/main.cpp index 24e4016..f6bface 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,8 +1,15 @@ -#include // this includes the standard lib to input and output stuff -using namespace std;// without this we would have to write std::cout insted of just cout +#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; // this displays the number in UsrNum +} int main() { - cout << "Soup \n"; // this prints soup in the command line and the \n means go down a line - cout << "Is good"; - return 0;// this tells all the functions and code to go back to main aka the start + NumberInput(); // this runs the NumberInput function + return 0;// this tells all the functions and code to go back to main aka the start } + From 9ce07151d119e8e485f75462086b6c01a5af592a Mon Sep 17 00:00:00 2001 From: Mark B Date: Thu, 22 Jul 2021 09:28:22 -0400 Subject: [PATCH 6/7] added string data --- src/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index f6bface..002d82e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,11 +5,19 @@ 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; // this displays the number in 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 } From d143904c1df6fee0abda6154cc9b1929613b63e7 Mon Sep 17 00:00:00 2001 From: Mark B Date: Sat, 24 Jul 2021 11:41:20 -0400 Subject: [PATCH 7/7] 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 +} +