Main.java x שיון Console Shell Files Markdown TA 1vV * O Preview of README.md f→ Main.java Index-Array-i... MREADME.md 2

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Main.java x שיון Console Shell Files Markdown TA 1vV * O Preview of README.md f→ Main.java Index-Array-i... MREADME.md 2

Post by answerhappygod »

 1
1 (145.24 KiB) Viewed 36 times
 2
2 (150.82 KiB) Viewed 36 times
Main.java x שיון Console Shell Files Markdown TA 1vV * O Preview of README.md f→ Main.java Index-Array-i... MREADME.md 2 Your Name 3 Date 4 FileName.java 5 brief description of what file does 6 */ 7 8 class Main { 9 public static void main(String[] args) { 10 11 12 13 14 } 15 } Create an IndexArray application that generates the number to store in an array element by summing its index and the individual digits of the index. For example, the element with index 17 should store 25 (17 + 1 + 7 = 25) and the element with index 2 should store 4 (2 + 0 + 2 = 4). Your program MUST use an array with 101 elements and then display the value at each element. ఒక 00 Application output should look similar to what is shown in Index-Array-img-2.png Note: Your code should align in columns as shown ✓ There is no need to write a separate method - you can do this in the main method. Make sure you include a comment block at the top of your code with the following information: Your name Date Project name a brief description of what the file does Submit as described. lu ? CPU RAM Stor...

Index-Array-img-2.png X Console Shell Markdown Files #I Preview of README.md 不如 Main.java Index-Arra... : MREADME.md DI Create an IndexArray application that generates the number to store in an array element by summing its index and the individual digits of the index. For example, the element with index 17 should store 25 (17 + 1 + 7 = 25) and the element with index 2 should store 4 (2 + 0 + 2 = 4). Your program MUST use an array with 101 elements and then display the value at each element. Generated Number Index 6 1 CANOS Application output should look similar to what is shown in Index-Array-img-2.png Note: Your code should align in columns as shown ✓ 2 4 6 8 19 12 14 16 18 11 13 15 17 8 There is no need to write a separate method - you can do this in the main method. 10 11 12 13 Make sure you include a comment block at the top of your code with the following information: Your name Date Project name a brief description of what the file does Submit as described. E E ? CPU RAM Stor... > LE

Main.java E Console Shell Markdown Instructions Files | 1/* Main.java M+ README.md Instructions Ā 2 Your info here 3 4. */ 5 6 7 class Main { 8 public static void main(String[] args) { 9 10 11 12 } 13 } Steps 3 1. In Main.java - recreate the code as shown below: import javax.swing.JOptionPane; //use JOptionPane import java.net. InetAddress; //Use the InetAddress Class from java.net package 00 public class Main ( public static void main(String[] argv) throws Exception { //necessary for this program ✓ [/Store the local host information InetAddress host - InetAddress.getLocalHost(); 1/Create an output string with the IP Address from the host. String output - "Network Information\nLocal Host IPv4 Address: + host.getHostAddress(); 1/Display the output string with the IP Address in a message dialog box JOptionPane.showMessageDialog(null, output, "IP Address", JOptionPane. WARNING_MESSAGE); 2. Note: Make sure you include the import statements at the top, as well as the throws Exception 3. When you run this it should look something like this: ? CPU RAM Stor...

e . Main.java Files 片 | F Console Shell Markdown Instructions al lice Lop, as well as LITE LIITUWS LACEPLIVIT 3. When you run this it should look something like this: Main.java M README.md 1/* 2 Your info here 3 4 */ 5 6 7 class Main { 8 public static void main(String[] args) { 9 10 11 12 } 13 } IP Address Network Information Local Host IPv4 Address: 172.18.0.129 OK > Workspace 11 4. Keep in mind that when you run this in replit it will likely show the IP address for replit's server, but if you run this code on your own computer - it should show the IP address of your local computer. (IP version 4) 5. There are no test cases - this is all you need to do, the assignment is to demonstrate some simple way to use Java graphics. = ? CPU RAM Stor... >
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply