Compare commits
No commits in common. "master" and "8c8a5acd95bcbf477250ce1ef9e1d86819d544e7" have entirely different histories.
master
...
8c8a5acd95
|
@ -0,0 +1 @@
|
|||
log.txt
|
15
README.md
15
README.md
|
@ -1,15 +1,2 @@
|
|||
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--------*
|
||||
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
|
||||
|
||||
this is just some hello world type C++ code with comments
|
||||
|
||||
|
|
1
TO-DO.md
1
TO-DO.md
|
@ -1 +0,0 @@
|
|||
add a file that has the number that someone typed aswell as their name
|
|
@ -0,0 +1,8 @@
|
|||
#include <iostream> // 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
|
||||
|
||||
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
|
||||
}
|
28
src/main.cpp
28
src/main.cpp
|
@ -1,28 +0,0 @@
|
|||
#include <iostream>
|
||||
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue