subject

1. 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 previous 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. Write a test program that creates a Stock object with the 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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:30, uh8hardiek
Ou listened to a song on your computer. did you use hardware or software?
Answers: 2
image
Computers and Technology, 23.06.2019 04:00, ittmanny6138
Laire writes a letter to her grandmother, in which she describes an amusement park she visited last week. she adds pictures of that place in her letter. which feature of a word processing program will claire to remove unwanted parts of the pictures?
Answers: 3
image
Computers and Technology, 23.06.2019 06:40, euniceyi56
How many nibbles can be stored in a 16-bit word?
Answers: 1
image
Computers and Technology, 23.06.2019 07:30, Morganwing1019
To check spelling errors in a document, the word application uses the to determine appropriate spelling. internet built-in dictionary user-defined words other text in the document
Answers: 2
You know the right answer?
1. Design a class named Stock that contains: • A string data field named symbol for the stock’s symb...

Questions in other subjects:

Konu
Biology, 01.03.2021 23:10
Konu
History, 01.03.2021 23:10
Konu
Mathematics, 01.03.2021 23:10