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
-
What is NOT an advantage of procurement through integrators? a. Convenience b. Maintain brand differentiation c. Leverage expertise d. Leverage purchasing power
-
Why are Resumes an important part in the hiring process? 2) Why do candidates need to submit a Cover Letter with their Resume? Is it needed? Especially in 2023? Give the Pros/Cons of Cover Letters....
-
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...
-
4c 5 /6 3c + 7 /4 Describe the solution set as an inequality, in interval notation, and on a graph.
-
In the Banach matchbox problem, find the probability that, at the moment when the first box is emptied (as opposed to being found empty), the other box contains exactly k matches.
-
Which model views the main components of the choice processproblems, solutions, participants, and choice situationsas all mixed up together in a dynamic and shifting field of organizational forces?...
-
Pettigrew Company produces a product that has a variable cost of $13 per unit; the product sells for $28 per unit. The companys annual fixed costs total $375,000; it had net income of $75,000 in the...
-
7 Which equation matches this description: Vertical asymptotes x=2 and x=5,-intercept x=-1,y-intercept y=1 (x-2) (x-5)
-
A body of rest mass m, collides perfectly inelastically at a speed of 0.8c with another body of equal rest mass kept at rest. Calculate the common speed of the bodies after the collision and the rest...
-
Explain the role of prices in allocating resources in a market economy and how changes in supply and demand affect prices. Provide specific examples of how government policies can influence market...
-
CM5: In the classic video game Donkey Kong, Donkey Kong is an ape who can move by rolling on top of a barrel, as in the figure. If the barrel is a hollow cylinder with a radius of 15 cm, length of 50...
-
Vanessa Robertson appealed the district court's grant of summary judgment to the State of Wisconsin's Department of Health Services ("DHS"). In her complaint, Ms. Robertson set forth claims under...
-
Case Analysis Critical thinking, creativity, and problem-solving are among some of the top skills needed by employers in the supply chain industry. This assignment will stretch your critical...
-
Write a paper for health psychology and i need help with integrating these questions into my paper. what counseling techniques do health psychologist use. what treatment methods do health...
-
Problem 10-18 (Algo) Return on Investment (ROI) and Residual Income (LO10-1, LO10-2] I know headquarters wants us to add that new product line," said Dell Havasi, manager of Billings Company's Office...
-
The time to assemble the first unit on a production line is 10 hours. The learning rate is 0.94. Approximately how long will it take for the seventh unit to be assembled? The number of hours needed...
-
Financial accounting theory has accumulated a vast literature. A cynic might be inclined to say that the vastness of the literature is in sharp contrast to its impact on practice. (a) Describe the...
-
What is the basic difference between the purposes of financial and managerial accounting?
-
Is it possible for costs such as salaries or depreciation to end up as assets on the balance sheet? Explain.
Study smarter with the SolutionInn App