Question: i need help with this problem. can not use arraylist/extends. other directions are given. 2. Stock.java (loosely based on #'s 2 and 10 from chapter

2. Stock.java (loosely based on #'s 2 and 10 from chapter 5 of your text) (10 points) Write a Java program to: request of your user a stock name - this is a string (such as Apple) request of your user a stock symbol - also a string (such as AAPL) - this should be converted to all caps - don't check if it was entered in all caps, automatically convert to all caps request of your user the price of the stock today - this is a double request of your user the number of shares of stock - this is an integer request of your user the price of the stock 6 months ago - this is a double calculate the total value of the stock now (number of shares stock price now) calculate the total value of the stock 6 months ago (number of shares stock price then) calculate the percent increase or decrease of the stock value (price now - price then) / price then)* 100) display alivalues format all monetary values to 2 decimal places. format output) This program should include at least the following methods in the application: . input a string - you can write one method for string input- use a specific argument to indicate what you are entering input an integer for the number of shares, use one method for this . input a stock price - again, use one method for this calculate stock value - write one method, call it twice (once for value now, one for value then) one method for output of all pertinent information You may choose to use a Utilities class, but make sure that the methods that you include in the Utilities are truly methods that can be used repeatedly by many different programs. You will not use an external constants file in this program A sample run of this program is below (user input is in bold/red): Enter your stock name: Apple Enter your stock symbol: aapl How many shares do you own? 100 What is the price of AAPL today? 113.49 What was the price of AAPL 6 months ago? 78.75 Stock name: Apple Stock symbol: AAPL Number of shares: 100 Stock price: Today: $113.49 6 months ago Stock value: $78.75 $11,349.00 $7,875.00 Apple percent change: 44.11%
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
