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 19:20
Write a program that reads a file consisting of students’ test scores in the range 0–200. it should then determine the number of students having scores in each of the following ranges: 0–24, 25–49, 50–74, 75–99, 100–124, 125–149, 150–174, and 175–200. output the score ranges and the number of students. (run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, 189.)
Answers: 3
question
Computers and Technology, 23.06.2019 00:30
Which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
Companies that implement and apply an information system effectively can create
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
To maintain clarity and focus lighting might be needed
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, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Social Studies, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
English, 11.09.2020 14:01
Questions on the website: 13722363