Hi, will you please explain it to me, step by step so I can understand it...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Hi, will you please explain it to me, step by step so I can understand it thoroughly? I am having time understanding it because there are new terms that I am not familiar with. Will you explain to me what or why is it in the code and the purpose of it. Explaining it to me step-by-step would be a big help. Thank you in advance! Will you also explain the output. Thank you again! 25 26 27 28 29 30 31 32 33 34 35 while (true) { System.out.print("\nInput your choice from navigation menu. " + "\nEnter [A or B or C or D or E or F] in block letter: "); char choice; choice = scan.next().charAt(0); System.out.println("\n--- if (choice == 'A') { System.out.println("The 10 Numbers You Entered Are: "); for (int i = 0; i < 10; i++) { } System.out.print(array[i] + "); }else if (choice == 'B') { System.out.println("Values of Even Indexes are: "); for (int i = 1; i < 10; i+=2) { } System.out.print(array[i] + "); == 'C') { System.out.println("Values of odd Indexes are: "); for (int i = 0; i < 10; i+=2) { } System.out.print(array[i] + " "); }else if (choice == 'D') { System.out.println("Array in elements ascending order: "); Arrays.sort(array); for (int i = 1; i < 10; i++) { System.out.print(array[i] + "); 36 37 38 39 40 41 42 }else if (choice 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 } 66 System.out.println("\n--- 67 } 68 } } }else if (choice == 'E') { System.out.println("Array in elements descending order: "); Arrays.sort(array); reverse(array); for (int i = 1; i < 10; i++) { } System.out.print(array[i] + "); } else if (choice == 'F') { System.out.println("You exit the menu"); break; } else { System.out.println("Invalid Choice entered."); 69 700 71 72 73 74 水龙龙4 75 76 77 public static void reverse (int[] array) { for (int i = 0; i < 10 / 2; i++) { } } 77} int temp = array[i] array[10 = array[i]; array[10 i- 1]; i-1] = temp; "); "); 7 8 9 10 11 12 13 1 import java.util.*; 3 public class Num2 { 1234569 50 public static void main(String[] args) { Scanner scan = new Scanner(System.in); int[] array = new int[10]; System.out.println("--- for (int i=1; i <= 10; i++) { " System.out.print("Enter Integer +i+ : "); array[i1] = scan.nextInt(); -Enter the elements of the array- -"); 14 } 15 16 17 18 19 20 21 22 23 24 25 System.out.println("\n--- System.out.println("A. Display the numbers"); System.out.println("B. Display the value of even indexes"); System.out.println("C. Display the value of odd indexes"); System.out.println("D. Display the value in ascending order"); System.out.println("E. Display the value in descending order"); System.out.println("F. Exit the Menu"); System.out.println("- while (true) { -NAVIGATION MENU- -"); -"); 26 System.out.print("\nInput your choice from navigation menu. 27 + "\nEnter [A or B or C or D or E or F] in block letter: "); 28 char choice; 29 30 choice = scan.next().charAt(0); System.out.println("\n-- -"); 31 if (choice == 'A') { 32 33 34 35 36 37 38 39 System.out.println("The 10 Numbers You Entered Are: "); for (int i=0; i<10; i++) { System.out.print(array[i] + "); 40 } } else if (choice == 'B') { System.out.println("Values of Even Indexes are: "); for (int i=1; i < 10; i+=2) { } System.out.print(array[i] + "); 41 42 } else if (choice == 'C') { 43 44 45 46 47 48 49 50 51 521 53 54 55 56 57 System.out.println("Values of odd Indexes are: "); for (int i=0; i < 10; i+=2) { } System.out.print(array[i] + "); }else if (choice == 'D') { System.out.println("Array in elements ascending order: "); Arrays.sort(array); for (int i=1; i < 10; i++) { } System.out.print(array[i] + "); } else if (choice == 'E') { System.out.println("Array in elements descending order: "); Arrays.sort(array); reverse (array); for (int i = 1; i < 10; i++) { Hi, will you please explain it to me, step by step so I can understand it thoroughly? I am having time understanding it because there are new terms that I am not familiar with. Will you explain to me what or why is it in the code and the purpose of it. Explaining it to me step-by-step would be a big help. Thank you in advance! Will you also explain the output. Thank you again! 25 26 27 28 29 30 31 32 33 34 35 while (true) { System.out.print("\nInput your choice from navigation menu. " + "\nEnter [A or B or C or D or E or F] in block letter: "); char choice; choice = scan.next().charAt(0); System.out.println("\n--- if (choice == 'A') { System.out.println("The 10 Numbers You Entered Are: "); for (int i = 0; i < 10; i++) { } System.out.print(array[i] + "); }else if (choice == 'B') { System.out.println("Values of Even Indexes are: "); for (int i = 1; i < 10; i+=2) { } System.out.print(array[i] + "); == 'C') { System.out.println("Values of odd Indexes are: "); for (int i = 0; i < 10; i+=2) { } System.out.print(array[i] + " "); }else if (choice == 'D') { System.out.println("Array in elements ascending order: "); Arrays.sort(array); for (int i = 1; i < 10; i++) { System.out.print(array[i] + "); 36 37 38 39 40 41 42 }else if (choice 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 } 66 System.out.println("\n--- 67 } 68 } } }else if (choice == 'E') { System.out.println("Array in elements descending order: "); Arrays.sort(array); reverse(array); for (int i = 1; i < 10; i++) { } System.out.print(array[i] + "); } else if (choice == 'F') { System.out.println("You exit the menu"); break; } else { System.out.println("Invalid Choice entered."); 69 700 71 72 73 74 水龙龙4 75 76 77 public static void reverse (int[] array) { for (int i = 0; i < 10 / 2; i++) { } } 77} int temp = array[i] array[10 = array[i]; array[10 i- 1]; i-1] = temp; "); "); 7 8 9 10 11 12 13 1 import java.util.*; 3 public class Num2 { 1234569 50 public static void main(String[] args) { Scanner scan = new Scanner(System.in); int[] array = new int[10]; System.out.println("--- for (int i=1; i <= 10; i++) { " System.out.print("Enter Integer +i+ : "); array[i1] = scan.nextInt(); -Enter the elements of the array- -"); 14 } 15 16 17 18 19 20 21 22 23 24 25 System.out.println("\n--- System.out.println("A. Display the numbers"); System.out.println("B. Display the value of even indexes"); System.out.println("C. Display the value of odd indexes"); System.out.println("D. Display the value in ascending order"); System.out.println("E. Display the value in descending order"); System.out.println("F. Exit the Menu"); System.out.println("- while (true) { -NAVIGATION MENU- -"); -"); 26 System.out.print("\nInput your choice from navigation menu. 27 + "\nEnter [A or B or C or D or E or F] in block letter: "); 28 char choice; 29 30 choice = scan.next().charAt(0); System.out.println("\n-- -"); 31 if (choice == 'A') { 32 33 34 35 36 37 38 39 System.out.println("The 10 Numbers You Entered Are: "); for (int i=0; i<10; i++) { System.out.print(array[i] + "); 40 } } else if (choice == 'B') { System.out.println("Values of Even Indexes are: "); for (int i=1; i < 10; i+=2) { } System.out.print(array[i] + "); 41 42 } else if (choice == 'C') { 43 44 45 46 47 48 49 50 51 521 53 54 55 56 57 System.out.println("Values of odd Indexes are: "); for (int i=0; i < 10; i+=2) { } System.out.print(array[i] + "); }else if (choice == 'D') { System.out.println("Array in elements ascending order: "); Arrays.sort(array); for (int i=1; i < 10; i++) { } System.out.print(array[i] + "); } else if (choice == 'E') { System.out.println("Array in elements descending order: "); Arrays.sort(array); reverse (array); for (int i = 1; i < 10; i++) {
Expert Answer:
Answer rating: 100% (QA)
Line Wise Explanation of given Program Line 1 import javautil It is Import Statement which is ... View the full answer
Related Book For
International Financial Reporting and Analysis
ISBN: 978-1408075012
5th edition
Authors: David Alexander, Anne Britton, Ann Jorissen
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
123 Compare the purely graphical properties of these two notations, and the ways in which the graphical properties of each display correspond to the information structure being defined. Describe...
-
Question 2A) Explain the differences between right issues and bonusissues. Your answer should include the advantages and disadvantagesof both right issues and bonus issues. [ 8marks}b) Explain pos 0...
-
Income statement information for Omega Corporation follows: Sales.................................$500,000 Cost of goods sold..................300,000 Gross profit...........................200,000...
-
Assume a $1,000 Treasury bill is quoted to pay 5 percent interest over a six-month period. a. How much interest would the investor receive? b. What will be the price of the Treasury bill? c. What...
-
The speeds of an electron and a proton have been measured to the same uncertainty. Which one has a larger uncertainty in position? A. The proton, because it's more massive. B. The electron, because...
-
The Quick Copy center for document copying is deciding where to locate a new facility. The annual fixed and variable costs for each site it is considering have been estimated as follows: If demand is...
-
Use the table for the question(s) below. Consider the following yields to maturity on various oneyear zerocoupon securities: Security Yield (%) Treasury 4.6 AAA corporate 4.8 BBB corporate 5.6 B...
-
A liquid with a density of 800 kg/m is flowing through a pipe with a diameter of 0.05 m at a velocity of 2 m/s. The pipe is insulated and the temperature of the liquid is 40C. Determine the mass flow...
-
Discuss how pay as you earn taxation upholds the principle of equitable taxation in Zambia
-
Analyze the complexities involved in implementing advanced real-time operating systems, focusing on issues such as task scheduling precision, interrupt latency, and the application of deterministic...
-
Once the nonprofit organization selects the theme for its new public service campaign, it wants to take all steps to ensure its success. Prior to launch, the organization will conduct a premortem...
-
Prompts 1. What was your best experience with a professional salesperson? 2. What was your worst experience with a professional salesperson? 3. What are your thoughts on the "4-Letter Code to Selling...
-
Discuss the meaning and implications of R-squared and the P-value. What is the meaning of each; how well do they work in determining how well our model predicts the outcome variable? Is the use of...
-
Tony and Jeannie Nelson are married and file a joint return. They have four children whose ages are: 12,15,19 & 23. The three youngest live at home with their parents and qualify as their...
-
Dawson Companys balance sheet information at the end of 2019 and 2020 is as follows: Additional information: The company did not issue any common stock during 2020. Required : Next Level Fill in the...
-
IAS 40 gives a choice of accounting policy in relation to investment properties. Is a choice acceptable? If not, how should IAS 40 be altered?
-
JKA acquired 50% of the issued ordinary share capital of CBX, an entity set up under a contractual agreement as a joint venture between JKA and one of its customers. JKA adopts a policy of...
-
The following draft statement of financial positions relate to Largo, a public limited company, Fusion, a public limited company and Spine, a public limited company, as at 30 November 20X3. The...
-
In the chapter, we mentioned that if Cafe Revive came up short four coffee gift packs, it should increase its cost of goods sold account and decrease its inventory account by the cost of those gift...
-
In terms of the accounting equation, where are changes in revenue and expense accounts recorded?
-
Johnson and Bates run a small business and are worried about their accounts receivable spiralling out of control. a Advise them of the steps they can take to manage credit and recover outstanding...
Study smarter with the SolutionInn App