Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

java detailed programed please You are building a program to help new investors select a stock based on certain criteria. To begin, the user enters

java detailed programed please
image text in transcribed
image text in transcribed
image text in transcribed
You are building a program to help new investors select a stock based on certain criteria. To begin, the user enters their money availoble to invest. Then, the user inputs the stock ticker, stock price, and the price-to-carnings (P/E) ratio. After the input is accepted, the program will display the ticker, stock price, P/E ratio and At of shares you will be able to purchase based on your available funds. Sample runs are at the end of this assignment. Requirementst - The stock price must be at least $5.00 We are forcing the user to purchase a stock that is at least $5.00 in value If a user enters a price below 55.00, display an error message and allow them to reenter a valid price. - If a user enters a P/E over 75, display a warning with the final output that says, "This stock may be overvalued. Proceed with caution!" - The tickers cannot be over 5 characters long M, VL, AMC, ViSL, CMCSA are acceptable, but ABCDEF is not If a user enters a ticker over 5 characters long. display an etror message and allow them to re-enter a valid ticker. - To accept the stock ticker, which is of type String, you need to use the following: Etring stooksider = inputinexthine () f (f input in name of the soander obj Additional Info: There is more info on this behavior in the textbook on page 484, section 12.11.4 Complete the program and uplosd the solution file as "StockSelecter.java" Hering ateckfieker a ingut-mentlina id f ff. input in name of the ecanner obj Addltional Info: There is exere info en this behavios in the textbook ea pace 4p4, section 12.11.4 Complete the program and uplows the solution file as "Sbockselectorjara" Sample Run 1t Welcone to the Stock Selector Appl Enter the total amount of noney you are udiling to invest: 5oege Enter the stock ticker: GENERAL Invaldd input. Try again. Enter the stock ticker: 6M Enter the price: 62.87 Enter the P/E Ratio: 8.4 Delow are your results: Stock: 64 Price: \$62.87 P/E Ratio: 8.4 J of shares able to purchase: 795 Sample Run 2i WeIcone to the Stock Selector Appl Enter the total anount of money you are w1l1Ing to invest. 50090 Enter the stock ticker: hD4Y Enter the pricet 4.95 Invalid price entered for stock. Try agaln. Enter the pricet 259.63 Enter the P/E Ratlo: 80 Below are your results: 5tock: WDAY Sarnple funs are at the end of this assignment. Requirements: - The stock price murt be at least 55.00 - We are forcing the user to purchase a stock that is at leat 55.00 in value D. If a user enters a price below S5.00, display an error message and allow them to reenter a valid price. - If a uses eaters a P/f over 75, divpley a waining with the finul outpoll thus sars. "This stock may be overvalued. Proceed with cautiont" - The tickers cannot be over 5 characters long o M, VL, AMIC, ViSL, CMCSA are acceptable, but Aacidtf is not 0 If a user enters a ticker over 5 characters iong, dispilay an errer metsage and allow them to re-enter a vald ticker. - To accept the stock ticker, which is of trpe String, you nend to use the following: Additional lnfe: There is more infe on this behavior in the taxtboek on puge tat, nection 12.11.4 Ceenplete the program and uplood the solution file as "StockSelecterjinva" Sample Run 1: Welcome to the Stock Selector Appl Enter the total asount of money you are uiling to invest: sacoe Enter the stock ticker: GEliERal. Invalid input. Try aeain. Enter the stock ticker: GH

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions