From 3a1b6549fc99a7f0a843f68d4b24de6fdbf496a3 Mon Sep 17 00:00:00 2001 From: Mark B Date: Fri, 16 Jul 2021 11:48:54 -0400 Subject: [PATCH] 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 } +