Compare commits
7 commits
8c8a5acd95
...
master
Author | SHA1 | Date | |
---|---|---|---|
d143904c1d | |||
9ce07151d1 | |||
3a1b6549fc | |||
3c731e9b9c | |||
0aa3c87ae4 | |||
33d9a70935 | |||
e6297c4fcd |
6 changed files with 45 additions and 10 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
log.txt
|
2
Makefile
Normal file
2
Makefile
Normal file
|
@ -0,0 +1,2 @@
|
|||
favnum: src/main.cpp
|
||||
g++ src/main.cpp -o favnum
|
15
README.md
15
README.md
|
@ -1,2 +1,15 @@
|
|||
this is just some hello world type C++ code with comments
|
||||
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
|
||||
|
||||
|
||||
|
|
1
TO-DO.md
Normal file
1
TO-DO.md
Normal file
|
@ -0,0 +1 @@
|
|||
add a file that has the number that someone typed aswell as their name
|
8
main.cpp
8
main.cpp
|
@ -1,8 +0,0 @@
|
|||
#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
Normal file
28
src/main.cpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#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 a new issue