Create a program that will perform the output below Fourth Quarter Java Programs 1: String Concatenation...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a program that will perform the output below Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: I. II. The program uses a switch statement to allow the user to choose a program: (2 pts) Choice 1. The program will concatenate two strings from the user input (5 pts) Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: 1 Enter First string: Black Enter Second string: Pink First String: Black Second String: Pink Concatenated string: BlackPink III. Choice 2. The program determines the common elements of the Arrays. (6 pts) (Note you must use Scanner to insert the first and second array elements. Array size must be three) Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: 2 Enter your first array elements: 5 3 2 Enter your second array elements: 2 First Array Elements [5, 3, 2] Second Array Elements: [2, 3, 1] The common arrays are: 32 IV. Choice 3. The program determines a number (Computer Generated) between 1 to 5. (8 pts) (NOTE 1: The user will attempt to guess the number three.) (NOTE 2: The program would exit if the user guessed the number correctly or exceeded the given tries.) Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: 3 I have a number between 1 to 5 Guess the number: 2 That's wrong. Tries 1 Guess the number: 1 That's wrong. Tries 2 Guess the number: 3 You guessed it! Program ended. V. Choice 4. The program sorts the array and determines the second-largest array. (6 pts) (Note you must use Scanner to insert the arrays. Array size must be Five) Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: 4 Enter your array elements: 1 5 2 4 6 The Original Numbers [1, 5, 2, 4, 6] The Sorted Numbers [1, 2, 4, 5, 6] : Second Largest Number is 5 VI. Choice 6. The program will end. (2pts) Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: 5 Program Terminated VII. Invalid Input. Displays an Invalid Choice message. (2pts) Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: 9 Invalid choice! The option is only 1 to 5! Create a program that will perform the output below Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: I. II. The program uses a switch statement to allow the user to choose a program: (2 pts) Choice 1. The program will concatenate two strings from the user input (5 pts) Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: 1 Enter First string: Black Enter Second string: Pink First String: Black Second String: Pink Concatenated string: BlackPink III. Choice 2. The program determines the common elements of the Arrays. (6 pts) (Note you must use Scanner to insert the first and second array elements. Array size must be three) Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: 2 Enter your first array elements: 5 3 2 Enter your second array elements: 2 First Array Elements [5, 3, 2] Second Array Elements: [2, 3, 1] The common arrays are: 32 IV. Choice 3. The program determines a number (Computer Generated) between 1 to 5. (8 pts) (NOTE 1: The user will attempt to guess the number three.) (NOTE 2: The program would exit if the user guessed the number correctly or exceeded the given tries.) Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: 3 I have a number between 1 to 5 Guess the number: 2 That's wrong. Tries 1 Guess the number: 1 That's wrong. Tries 2 Guess the number: 3 You guessed it! Program ended. V. Choice 4. The program sorts the array and determines the second-largest array. (6 pts) (Note you must use Scanner to insert the arrays. Array size must be Five) Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: 4 Enter your array elements: 1 5 2 4 6 The Original Numbers [1, 5, 2, 4, 6] The Sorted Numbers [1, 2, 4, 5, 6] : Second Largest Number is 5 VI. Choice 6. The program will end. (2pts) Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: 5 Program Terminated VII. Invalid Input. Displays an Invalid Choice message. (2pts) Fourth Quarter Java Programs 1: String Concatenation 2: Common Array 3: If Else Random Number 4: Sorting Array 5: Quit Enter your choice: 9 Invalid choice! The option is only 1 to 5!
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
In a Hopfield neural network configured as an associative memory, with all of its weights trained and fixed, what three possible behaviours may occur over time in configuration space as the net...
-
A small company has $4,500,000 in (annual) revenue, spends 57% of its revenues on purchases, and has a net profit margin of 11.75%. They would like to increase their profits and they are looking at...
-
1 / 2x 5/6 1/3 + 3/2 x Describe the solution set as an inequality, in interval notation, and on a graph.
-
Access the February 20, 2015, filing of the December 31, 2014, 10-K report of The Hershey Company (ticker HSY) at www.SEC.gov and complete the following requirements. Required Compute or identify the...
-
Suppose your AC for the project was $100,000 and your EV was $78,000. What is the value of your projects CPI?
-
Rehm Company manufactures a product that is available in both a deluxe model and a regular model. The company has manufactured the regular model for years. The deluxe model was introduced several...
-
Vectors u = 6(cos 601 + sin60), v = 4(cos 3151 + sin315), and w = -12(cos 3301 + sin330) are given. Use exact values when evaluating sine and cosine. Part A: Convert the vectors to component form and...
-
Ms Moore owns a 16 unit apartment complex. The market rent on each unit is $500 per month. It is expected that on average, one unit will be vacant for the 3 months a year. The annual operating...
-
Income Statements for Year 2 Segment Sales Cost of goods sold Sales commissions Contribution margin General fixed operating expenses (allocation of president's salary) Advertising expense (specific...
-
Buzzard Bicycle specializes in custom painting and design of bicycles. December 31 is the company's fiscal year-end. Information necessary to prepare the year-end adjustments appears below. 1. A...
-
TAP purchased land on January 1 , 2 0 1 3 for $ 2 5 0 million. As of January 1 , 2 0 1 8 , the fair value was estimated to be $ 2 9 0 million. TAP purchased a trademark on January 1 , 2 0 1 6 for...
-
Selling price Variable expenses Contribution margin Per Unit $ 100 61 $ 39 Percent of Sales 100% 61 398 Fixed expenses are $80,000 per month and the company is selling 3,700 units per month. Exercise...
-
(a) What is the efficiency of an out-of-condition professor who does 1.90 x 105 ] of useful work while metabolizing 510 kcal of food energy? % 0.089 (b) How many food calories (in kcal) would a...
-
Write a paper about Ethnography: Db ELETNEE
-
r = 0.18 Find the coefficients of determination and non-determination and explain the meaning of each.
-
A plane gate of uniform thickness holds back a depth of water as shown. Find the minimum weight needed to keep the gate closed. 0=30 L=3m Water w=2m P3.45
-
Obtain an expression for the kinetic energy flux, \(\int\left(V^{2} / 2 ight)\) \(ho \vec{V} \cdot d \vec{A}\), through cross section (1) of the control volume shown. x CV Width = w P4.12 h V
-
The velocity distribution for laminar flow in a long circular tube of radius \(R\) is given by the one-dimensional expression, \[\vec{V}=u \hat{i}=u_{\max }\left[1-\left(\frac{r}{R} ight)^{2} ight]...
Study smarter with the SolutionInn App