subject

Following the example of the circle class, design a class named stock that contains:
a)- a string data field named symbol for the stocks symbol.
b)- a string data field named name for the stocks name.
c)- a double data field named previousclosingprice that stores the stock price for the previous day.
d)- a double data field named currentprice that stores the stock price for the current time.
e)- a constructor that creates a stock with a specified symbol and name.
f)- a method named get changepercent() that returns the percent- age changed from previous closingprice to currentprice.
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, 23.06.2019 08:00
Match the items with their respective descriptions.
Answers: 1
question
Computers and Technology, 24.06.2019 02:30
How to apply the fly in effect to objects on a slide
Answers: 1
question
Computers and Technology, 24.06.2019 14:30
In a home that has 120 v service, there is an electric appliance that has a resistance of 12 ohms. how much power will this appliance consume? a. 10 w b. 120 w c 1200 w d. 1440 w
Answers: 1
question
Computers and Technology, 25.06.2019 05:30
The piston ring isn't a completely solid ring; instead, it's usually split at one point. this split or gap in the ring is called the a. ring spacing. b. ring clearance. c. ring end gap. d. ring side clearance.
Answers: 2
You know the right answer?
Following the example of the circle class, design a class named stock that contains:
a)- a st...
Questions
question
Mathematics, 22.03.2020 03:40
question
Mathematics, 22.03.2020 03:41