Following the example of the Circle class in Section 9.2 , 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 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 stock symbol ORCL, the name Oracle Corporation, and the previous closing price of 34.5. Set a new current price to 34.35. Select 9 more stocks with the current prices and create objects with the current prices as previous Closing prices. After 2 or more days get the price for each stock in your list and use the currentPrice method to store the current prices. Use a for loop to display all the socks Symbols, Name of Stock, Old Price, Current Price and the Price-Change percentage. Use appropriate formatting to show the Currency sign with two decimals. Prompt the user to enter the stock symbol and the number of stocks bought. Compute the profit and display the Stock Symbol, Stock Name, Number of Stock, Total purchase cost, Total selling cost, profit made and profit percentage. Display your name with the text ‘Investment Advisor’. Following the example of the Circle class in Section 9.2 , 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 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 stock symbol ORCL, the name Oracle Corporation, and the previous closing price of 34.5. Set a new current price to 34.35. Select 9 more stocks with the current prices and create objects with the current prices as previous Closing prices. After 2 or more days get the price for each stock in your list and use the currentPrice method to store the current prices. Use a for loop to display all the socks Symbols, Name of Stock, Old Price, Current Price and the Price-Change percentage. Use appropriate formatting to show the Currency sign with two decimals. Prompt the user to enter the stock symbol and the number of stocks bought. Compute the profit and display the Stock Symbol, Stock Name, Number of Stock, Total purchase cost, Total selling cost, profit made and profit percentage. Display your name with the text ‘Investment Advisor’.
Following the example of the Circle class in Section 9.2 , 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 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 stock symbol ORCL, the name Oracle Corporation, and the previous closing price of 34.5. Set a new current price to 34.35. Select 9 more stocks with the current prices and create objects with the current prices as previous Closing prices. After 2 or more days get the price for each stock in your list and use the currentPrice method to store the current prices.
Use a for loop to display all the socks Symbols, Name of Stock, Old Price, Current Price and the Price-Change percentage. Use appropriate formatting to show the Currency sign with two decimals.
Prompt the user to enter the stock symbol and the number of stocks bought. Compute the profit and display the Stock Symbol, Stock Name, Number of Stock, Total purchase cost, Total selling cost, profit made and profit percentage.
Display your name with the text ‘Investment Advisor’.
Following the example of the Circle class in Section 9.2 , 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 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 stock symbol ORCL, the name Oracle Corporation, and the previous closing price of 34.5. Set a new current price to 34.35. Select 9 more stocks with the current prices and create objects with the current prices as previous Closing prices. After 2 or more days get the price for each stock in your list and use the currentPrice method to store the current prices.
Use a for loop to display all the socks Symbols, Name of Stock, Old Price, Current Price and the Price-Change percentage. Use appropriate formatting to show the Currency sign with two decimals.
Prompt the user to enter the stock symbol and the number of stocks bought. Compute the profit and display the Stock Symbol, Stock Name, Number of Stock, Total purchase cost, Total selling cost, profit made and profit percentage.
Display your name with the text ‘Investment Advisor’.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps