SHARE
TWEET

dlove2

a guest Apr 25th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. char X;
  2.     char name[21];
  3.     float opening, closing, amtofshares, result;
  4.  
  5.     cout << "Enter the name of the stock: ";
  6.     cin >> name;
  7.  
  8.     cout << "Enter the amount of shares you have: ";
  9.     cin >> amtofshares;
  10.  
  11.  
  12.     cout << "Enter the opening value: ";
  13.     cin >> opening;
  14.  
  15.     cout << "Enter the closing value: ";
  16.     cin >> closing;
  17.  
  18.     // system('cls');
  19.  
  20.     result = (amtofshares * closing) - (amtofshares * opening);
  21.  
  22.     cout << "---------------------------------------------------------" << '\n';
  23.     cout << "The name of the stock is: "  << name << '\n';
  24.     cout << "The amount of the stock you currently have is: "  << amtofshares << '\n';
  25.     cout << "The opening value is: "  << opening << '\n';
  26.     cout << "The closing value is: "  << closing << '\n';
  27.     cout << "You have gained "  << result << " of stocks." << '\n';
  28.    
  29.     cin >> X;
  30.     return 0;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top