Compare commits

..

No commits in common. "master" and "8c8a5acd95bcbf477250ce1ef9e1d86819d544e7" have entirely different histories.

6 changed files with 10 additions and 45 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
log.txt

View File

@ -1,2 +0,0 @@
favnum: src/main.cpp
g++ src/main.cpp -o favnum

View File

@ -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

View File

@ -1 +0,0 @@
add a file that has the number that someone typed aswell as their name

8
main.cpp Normal file
View File

@ -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
}

View File

@ -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
}