Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Tutorials found on BrandonHok.com
- #include <iostream>
- int main()
- {
- // [Section 1]
- // Try running this section set first. Do not add any other code yet.
- // What happens when you erase std::cin.get();?
- std::cout << "What do you think cout does?\n";
- std::cout << "Try pressing a number now\n";
- std::cin.get();
- // [Section 2]
- // Add these statements now.
- // We are introducing what is a variable now. Basically like in math x = o
- // What is variable222?
- // What happened? Do you know why?
- int variable1 = 777;
- int variable222;
- // [Section 3]
- // What happened here? Why did the number 777 appear?
- // What do you think \n does? Try erasing it and see what happens.
- std::cout << variable1 << "\n";
- std::cout << "End of Section 3\n";
- system("pause");
- // [Section 4]
- // What do you think cin do?
- // What do you think cout do?
- // What do you think << and >> do?
- // What do you think std::endl; does? Try erasing it and see what happens.
- std::cin >> variable222;
- std::cout << variable222 << "\nWhat do you think cout and cin does?\n" << std::endl;
- std::cout << "End of Statement 4" << std::endl;
- system("pause");
- // [Statements 5]
- // What do you think happened here?
- // What happened to variable3 and variable4 in the beginning and end?
- int variable3;
- int variable4;
- std::cin >> variable3 >> variable4;
- std::cout << variable3 << " This is variable3" << std::endl;
- std::cout << "Try a 3 digit number now" << std::endl;
- std::cin >> variable3 >> variable4;
- std::cout << variable3 + variable4 << std::endl;
- system("pause");
- // Summarize the lesson on paper. What are the major concepts today?
- // What do you think this statement does? You may want to google it and learn more about it.
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement