Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Brandan Tyler Lasley
- Project: CS 162 ASSIGNMENT #1, Nicks Crystal Ball
- Sources: None
- This allows a user to input infomation into a verible and then return that infomation back to the user in a friendly
- sentence.*/
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- // Declare the veribles name and subject for storage.
- string name;
- string subject;
- // Output a welcome message to the usr.
- cout << "Welcome to Brandan's Crystal Ball!";
- cout << endl;
- // Ask the usr a question, its name.
- cout << "What is your name, please? ";
- // Ask for an input and store that input in the [string] veriable 'name'.
- cin >> name;
- // Print out a greetings including the name that was just recently harvested from the usr.
- cout << "Hello, " << name << ". My name is Brandan";
- cout << endl;
- // Ask the usr what subject they're studying, expecting reply.
- cout << "What subject are you studying? ";
- // Collect the input and store into the [string] varible 'subject'
- cin >> subject;
- // Give a prediction of the usrs future including the name and the subject varibles.
- cout << "Well, " << name << ", Brandan's crystal ball says you will do very well in"
- << subject << " this term." << endl << "Good luck!" << endl;
- // pause
- system("pause");
- // exit
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement