Question
Design a class named Stock to represent a stock. The class contains: A data field named symbol (e.g. $, ORCL) for the stocks symbol. A
Design a class named Stock to represent a stock. The class contains:
A data field named symbol (e.g. $, ORCL) for the stocks symbol.
A data field named name (e.g. dollar, Oracle Corporation) for the stocks name.
A data field named previousClosingPrice that stores the stock price for the previous day.
A data field named currentPrice that stores the stock price for the current time.
A constructor that creates a stock with the specified symbol and name.
A method named getChangePercent() that returns the percentage changed from previousClosingPrice to currentPrice.
A default constructor that creates a default stock.
Draw UML Diagram of the class above and implement the class.
HINT CODING IN C++
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started