Oops. The assignment got lost somewhere in the posting.
Stock Portfolio Develop an application that allows users to "play the stock market." Users will be able to buy and sell stock, and find out the value of each stock as well as the value of their portfolio. Stock prices will fluctuate. This application will be developed in stages.
In stage I, you will create the Stock class that will have instance variables of name, purchase price, number of shares, and current price. You will need methods to gain access to the instance variables and method to randomly adjust stock prices up or down (generate a random number between -I and + I and multiply that value by the price per share and assign it to a variable called current price). A main() method can also be included for
testing. There should be at least 9 methods for this class. The name of the class will be Stock.
In another class called PlayStock the main() method is where
you should ask the user the name, purchase price and number of shares. Next, you will simulate the fluctuation of stock prices by increasing or decreasing the stock price randomly. After adjusting the price, print the stock name, purchase price, number of shares and current price. The main() method should also calculate and display the value of the stock by multiplying the number of shares by the current price, how much it was when purchased and the gain or loss (a positive number is a gain and a negative number is a loss).
To convert your stock names to upper case, use the toUpperCase() method of the
String class. To round your decimal values, use the format() method of the DecimalFormat class.
[ July 16, 2003: Message edited by: Marilyn de Queiroz ]