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, 22.06.2019 11:10
Which are not examples of chronic or persistent stress? moving
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. sean is a computer programmer. he has programmed an application for toddlers that plays nursery rhymes. however, a logic error has occurred in the program. which problem is a likely consequence of the error? a. the program crashes every time the user wants to play the nursery rhymes. b. the program crosses its buffer boundaries and overwrites an adjacent program. c. the program plays a different nursery rhyme than the one the user intended to play. d. the program shows different structures in its programming language code. e. the program introduces new viruses every time the user plays a nursery rhyme.
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
What is the next step if your volume does not work on computer
Answers: 2
question
Computers and Technology, 24.06.2019 19:30
Dtp allows you to manipulate text boxes in the following ways. more than 1 answer. a.move them b.rotate them c.resize them d.all of the above e.none of the above
Answers: 1
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, 05.12.2019 08:31
question
Chemistry, 05.12.2019 08:31