Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char X;
- char name[21];
- float opening, closing, amtofshares, result;
- cout << "Enter the name of the stock: ";
- cin >> name;
- cout << "Enter the amount of shares you have: ";
- cin >> amtofshares;
- cout << "Enter the opening value: ";
- cin >> opening;
- cout << "Enter the closing value: ";
- cin >> closing;
- // system('cls');
- result = (amtofshares * closing) - (amtofshares * opening);
- cout << "---------------------------------------------------------" << '\n';
- cout << "The name of the stock is: " << name << '\n';
- cout << "The amount of the stock you currently have is: " << amtofshares << '\n';
- cout << "The opening value is: " << opening << '\n';
- cout << "The closing value is: " << closing << '\n';
- cout << "You have gained " << result << " of stocks." << '\n';
- cin >> X;
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement