Advertisement
Brandan

Nicks Crystal Ball

Sep 27th, 2013
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.32 KB | None | 0 0
  1. /* Brandan Tyler Lasley
  2. Project: CS 162 ASSIGNMENT #1, Nicks Crystal Ball
  3. Sources: None
  4.  
  5. This allows a user to input infomation into a verible and then return that infomation back to the user in a friendly
  6. sentence.*/
  7.  
  8.  
  9. #include <iostream>
  10. #include <string>
  11. using namespace std;
  12.  
  13. int main() {
  14.     // Declare the veribles name and subject for storage.
  15.     string name;
  16.     string subject;
  17.  
  18.     // Output a welcome message to the usr.
  19.     cout << "Welcome to Brandan's Crystal Ball!";
  20.     cout << endl;
  21.  
  22.     // Ask the usr a question, its name.
  23.     cout << "What is your name, please? ";
  24.  
  25.     // Ask for an input and store that input in the [string] veriable 'name'.
  26.     cin >> name;
  27.  
  28.     // Print out a greetings including the name that was just recently harvested from the usr.
  29.     cout << "Hello, " << name << ". My name is Brandan";
  30.     cout << endl;
  31.  
  32.     // Ask the usr what subject they're studying, expecting reply.
  33.     cout << "What subject are you studying? ";
  34.  
  35.     // Collect the input and store into the [string] varible 'subject'
  36.     cin >> subject;
  37.  
  38.     // Give a prediction of the usrs future including the name and the subject varibles.
  39.     cout << "Well, " << name << ", Brandan's crystal ball says you will do very well in"
  40.         << subject << " this term." << endl << "Good luck!" << endl;
  41.  
  42.  
  43.     // pause
  44.     system("pause");
  45.  
  46.     // exit
  47.     return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement