The Five Steps - Step 1
Understand the problem
- What is this program supposed to do?
-
From the task description, and our initial simplifying assumptions,
we can see that the program is supposed to compute the value of one
stock.
- What kind of information is it given?
(What is the input?)
-
We are given the number of shares of stock owned,
and the stock value, expressed as 3 numbers (whole dollars, and the numerator
and denominator of the fraction).
- What kind of results is it to produce?
(What is the output?)
-
We should produce the value of the portfolio in dollars.
- What formulas or techniques will be needed?
-
The value of the stock is simply the number of shares times the stock price.
The stock price is the whole dollars plus the numerator/denominator of
the fractional part.
Write an algorithm for solving the problem
Translate the algorithm into a programming language (like C)
Test the program
to Overview.