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
-
After you have reviewed the Assignment Details below, click the Launch Discussion Board link under the Assignments tab for this unit to open the Discussion Board and make your post. Use these videos...
-
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...
-
What is a forming limit diagram?
-
Figure P8.49 shows two springs attached to a block that can slide on a friction less surface. In the block's equilibrium position, the left spring is compressed by 2.0 cm. a. By how much is the right...
-
Presented below are summary financial data from Porter's annual report: Calculate the following ratios: a. Times-interest-earned ratio b. Quick ratio c. Current ratio Balance sheet Cash and cash...
-
Why might it be desirable to operate enterprise funds at a profit?
-
Consider a four-year project with the following information: initial fixed asset investment $480,000; straight-line depreciation to zero over the four-year life; zere salvage value; price $31;...
-
The shareholders of X Ltd. are unhappy about the top manager's performance. While the manager's effort in running the firm cannot be observed, it is felt that he or she puts in effort amounting to...
-
Question two (20mks) Building Societies Act is a well structured and balanced Organism that spells out different functions. Identify and describe the organization and management of building society...
-
Which canada act article should i add to the technology upgrade union negotiation simulation(to propose language change in a company there is no previous articel) in a ontario based heat and cool...
-
How can HR professionals expand physician recruiting and talent programs? How to utilize cost-effectiveness of attracting and retaining top medical talent?
-
If the image you generated was from the Z 2 shim coil using 1,232 DAC units, and if the field at z = 3 cm was offset by 381 Hz from the field at the center of the magnet, what would be the strength...
-
During 2 0 2 3 , John Colburn, a single individual, reports the following taxable income: Gross income from business $ 2 0 0 , 1 5 0 Less: Business expenses 2 4 0 , 0 0 0 ( $ 3 9 , 8 5 0 ) Plus:...
-
Consider the functions y=sin(x)-3 and y = cos(x) + 4. (Do not graph them yet.) A. How do you think the graphs of y=sin(x)-3 and y= cos(x) + 4 differ from the graphs of their parent functions,...
-
Explain the following (i) Dynamics (ii) Kinematics (iii) Position (iv) Velocity (v) Acceleration (vi) Degrees of freedom (vii) Cartesian coordinates
-
Economic feasibility is an important guideline in designing cost accounting systems. Do you agree? Explain.
-
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...
-
Consider a publicly-held company whose products you are familiar with. Some examples might include: Access the companys public website and search for its most recent annual report. (Note: Some...
-
The 2014 financial statements of LVMH Moet Hennessey-Louis Vuitton S.A. are presented in Appendix C of this book. LVMH is a Paris-based holding company and one of the worlds largest and best-known...
-
San Francisco Sea Salt's controller prepared the following statements of cash flow (in thousands of dollars) for the past two years, the current year (2020), and the upcoming year (2021): After...
Study smarter with the SolutionInn App