#include <iostream>using namespace std;int main(){ cout << "Paul Adamski"; //cin.get(); If the console flashes}
Problem 2
#include <iostream>int main(){ std::cout << "There are many mistakes in this code." << std::endl; std::cout << "Can you help me fix all the bugs in this code" << std::endl << std::endl; std::cout << "Thank You!" << std::endl;}
Counted 13.
Problem 3
#include <iostream>using namespace std;int main(){ cout << "*******\n"; cout << " *****\n"; cout << "*******\n"; cout << " *****\n"; //cin.get(); If program flases}
Problem 4
#include <iostream>using namespace std;int main(){ int age; cout << "Please enter your age: "; cin >> age; cout << "You are " << age << " years old."; //cin.ignore(2); If program flases}
Problem 5
[source="cpp"]#include <iostream>using namespace std;int main(){ int iNumberOne; int iNumberTwo; cout << "Please give us a number: "; cin >> iNumberOne; cout << "Please give us one more number: "; cin >> iNumberTwo; cout << endl; cout << "If you add those two numbers together you get " << iNumberOne + iNumberTwo << endl; cout << "If you subtract those two numbers together you get " << iNumberOne - iNumberTwo << endl; cout << "If you multiply those two numbers together you get " << iNumberOne * iNumberTwo << endl; cout << "If you divide those two numbers together you get " << iNumberOne / iNumberTwo << endl; cin.ignore(2); }
None of them were hard, hopefully they'll get harder in the next lesson. BTW: For Problem 5, you'd probably want to do a if statement to see which number is bigger, because usually your going to do the big one minus the smaller one.