### I cant figure out the program for this question.

Kathryn bought 750 shares of stock at the price of \$35.00 per share. A year later she sold them for just #31.15 per share. Write a program that calculates and displays the following:
- The total amount paid for the stock
- The total amount received from selling the stock.
- The total amount of money she lost.
1) 35 * 750 = 26250 <-- That's how much the shares costed.
2) 31.15 * 750 = 23362.5 <-- That's how much Kathryn's shares made made her after a year.
3) The total amount of money she lost is the difference between them.

It's a simple arithmetic program you can write yourself. So start writing it and post showing your attempt should you need further guidance.
// This program calculates stocks
#include<iostream>
using namespace std;

int main()
{
/****************************************/
/* display current stock
/* Amount Received Selling stock
/* Calculate Money Lost
/***************************************/
int currentstock, received, moneylost;

currentstock = 750;

cout << "The current stock price is";
cin >> "750";

}
 `` `` ``cin >> "750";``

This is invalid. Are you sure you understand how cin works?
To be completely honest no , my teacher blows through our chapters like we understand it so I've had to self teach myself . But no matter how many times i look at the book I can't grasp it.
Maybe this is easier to understand.
http://www.cplusplus.com/doc/tutorial/basic_io/
Kind of , I'm just stuck on what to put for the rest of this program.
Look at:
http://www.cplusplus.com/doc/tutorial/variables/

To display means to output. The `cin` is about input. What input should your program receive?

You (essentially) wrote:
 ``12`` ``````int received; received = 31.15;``````

The `int` means integer, a whole number. Is the 31.15 an integer?

Last, please use code tags when posting code. See http://www.cplusplus.com/articles/jEywvCM9/
Topic archived. No new replies allowed.