Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Starter Code import java. util. Scanner; public class InvestmentPortfolio { static Scanner input = new Scanner(System.in); // public static void main(String[] args) { } /*

image text in transcribed

image text in transcribed

Starter Code import java. util. Scanner; public class InvestmentPortfolio \{ static Scanner input = new Scanner(System.in); // public static void main(String[] args) \{ \} /* / 1 * method displaystockStatus displays the status of the stocks * @param stockSymbolstist: String array * @param stockNameList: String array * @param previousclosingPrice: float array * @param currentPrice: float array / private static void displaystockStatus() \} 1/ / * method displayEquitySummary displays the value of share equity of the stocks owned by each client * @param stockSymbolsList * @param currentPrice */ private static void displayEquitysummary() \{ \} I* / / method getClientsInfo() fills the arrays: clientNames[], clientIDs [] , aaplShare[], msftshare[], and googlShare[] public static void getClientsInfo() \{ \} // / method getChangePercent () calculates and returns the percentage changed from previousclosingPrice to currentPrice * @param currentPrice * @param previousclosingPrice Your application must include a class named "InvestmentPortfolio" that shows a summary of client's investment portfolio or the full details of stock status with the change percent in the stocks' prices. You should do the following tasks: 1. Use the starter code found in this file. 2. For simplicity, the total number of the clients is 5. 3. Create the following variables: ( 9ppts) a. A string data field named "symbol" for the stock's symbol. b. A string data field named "name" for the stock's name. c. A double data field named "previousClosingPrice" that stores the stock price for the previous day. d. A double data field named "currentPrice" that stores the stock price for the current time. e. A String array data field named "clientNames" that stores the clients' last names. f. A String array data field named ""clientIDs" that stores the client ID (5-digit length) g. 3 int arrays named aaplShare, msftShare, and googlShare respectively to store the share of every stock for each client. 4. Write the header and bodies of the following methods: (25pts) a. method getClientsInfon method is called to fill the arrays: clientNames[], clientIDs[], aaplShare[], msftshare[], and googlshare[] (3pts) b. method displayStockStatus9 which has the parameters stockSymbolsList: String array, stockNameList: String array, previousClosingPrice; float array, and currentPrice; float array. The method displays the status of the stocks as shown in the sample run. (10pts) c. method displayEquitySummary which computes and displays the value of share equity of the stocks owned by each client. It takes the parameters: stockSymbolskist: String array, and currentPrice; float array. (10pts) d. method getChangepercento that returns the percentage changed from previous closing prices to current prices with the format (00.00%). Note: The percent change formula is as follows: (2pts) ChangePercent=prevoiusclosingpricecurrentpriceprevoiusclosingprice100 5. Create the following local variables: (5pts) a. A single dimensional string array named "stockSymbolsList" with the values "AAPL", "MSFT", and "GOOGL" b. A single dimensional string array named "stockNameList" with the values "Apple Inc.", "Microsoft", and "Alphabet Inc." c. A single dimensional float array named "previousClosingPrice", with the values $0.40,$25.99 and $148. d. A single dimensional float array named "currentPrice" with the values $141.52,$257.22, and $95. e. An int variable named serviceID. 6. Use the following three programming tools (but not limited to): (11pts) a. A do-while loop to show a menu to the user. (3pts) b. A switch statement to select the required service and store it in serviceID. (4pts) c. Calling methods in main. (4pts) d. For loops to read from the created arrays, when necessary, in the methods. (Included in methods worth) e. For loops to print the contents of the arrays formatted properly, when necessary, in the methods. (Included in methods worth)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

1. Define mass and mediated communication

Answered: 1 week ago