Question: java without using any loop or if else or while just if 1. Create a class called Stock that can be used to handle stock
java without using any loop or if else or while just if

1. Create a class called Stock that can be used to handle stock marker operations. Your class should contain the following: 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 name previousClosingPrice that stores the stock price for the previous day .A double data field named currentPrice hat stores the stock price for the current time . A constructor that creates a stock with specified symbol and name . The set method for all data fields .The get method for all data fields . A method named changePercent that returns the percentage changed from to surrentPrics Write a test program that creates two Stock class objects with the following information: Stock symbol ABC, the name NameInc, and the previous closing price of 60. Set a new current price to 65 and display the price-change percentage. . Stock symbol BCC, the name News Inc., and the previous closing price of 100. Set a new current price to 110 and display the price-change percentage. Sample Output: Stock Information: Symbol: ABC Name: Name Inc. Previous Closing Price: 60.00 Current Price: 65.00 Price-changed Percentage: 8.33 % Symbol: BCC Name: News Inc. Previous Closing Price: 100.00 Current Price: 110.00
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
