Computers and Technology

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:00, DRock4976
Which of the following is not contained on the slide show toolbar? a. next button b. slide button c. close button d. pen too
Answers: 2
image
Computers and Technology, 22.06.2019 18:00, deathfire5866
Determine whether the following careers would require training or college.
Answers: 1
image
Computers and Technology, 23.06.2019 15:30, taapeters
Brian wants to conduct an online search with a certain phrase. he intends to use the words books that belong to the 1800s in his search. how should he use the word that in his search?
Answers: 1
image
Computers and Technology, 23.06.2019 17:30, granta1
Write pseudocode to represent the logic of a program that allows the user to enter a value. the program multiplies the value by 10 and outputs the result.
Answers: 1
Do you know the correct answer?
Following the example of the circle class, design a class named stock that contains:
a)- a st...

Questions in other subjects: