subject

(The Stock class) Design a class named Stock that contains: • A string data field named symbol for the stock’s symbol.
• A string data field named name for the stock’s name.
• A double data field named previousClosingPrice that stores the stock price for the
previous day.
• A double 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.
Draw the UML diagram for the class and then implement the class. Write a test program that
creates a Stock object with the stock symbol ORCL, the name Oracle Corporation, and the
previous closing price of 34.5. Set a new current price to 34.35 and display the price-change
percentage.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:10
Type the correct answer in the box. spell all words correctly. which technology should andrea use? andrea owns a potato chips manufacturing unit. she has been getting complaints about the quality of the chips. she knows her product is good. she realizes that she needs to change the way the chips are packaged. she should use technology, which uses gases, such as carbon dioxide or argon, to create an air cushion, which improves the shelf life of products.
Answers: 2
question
Computers and Technology, 22.06.2019 09:40
In the lab, which of the following displayed a list of all installed services and included a description of the service, the current state, and whether the service started automatically or manually? a. the services manager b. the applications summary c. the recommended services d. list the safe services list
Answers: 2
question
Computers and Technology, 22.06.2019 11:00
Eva has many contacts on the professional networking site she uses which contacts are considered second degree
Answers: 3
question
Computers and Technology, 22.06.2019 18:00
Budgets you to do all of the following expect a) send frivolously b) avoid over spending c) gain financial independence d) examine your priorities and goals
Answers: 2
You know the right answer?
(The Stock class) Design a class named Stock that contains: • A string data field named symbol for...
Questions
question
Business, 29.02.2020 01:25