Question: 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
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 all values 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
