Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program to create an array with 5 integer values: 10, 20, 30, 40, 50. And then print the array data to monitor. This

Write a program to create an array with 5 integer values: 10, 20, 30, 40, 50. And then print the array data to monitor. This is what i have, but i get errors in the code.

package lab1; import java.util.Scanner; public class Lab1 {

public static void main(String[] args) { private static Scanner scanner = new Scanner(System.in);

public static void main(String[] args) { int[] array = {10,20,30,40,50}; System.out.println("Number at index 0: "+array[0]); System.out.println("Number at index 1: "+array[1]); System.out.println("Number at index 2: "+array[2]); System.out.println("Number at index 3: "+array[3]); System.out.println("Number at index 4: "+array[4]); } } }

I am trying to do this on netbeans but i am stuck and cant figure this out, can someone help me please

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

What is the difference between a one-tail test and a two-tail test?

Answered: 1 week ago

Question

8.6 Discusstwo techniques used for assessing training needs.

Answered: 1 week ago

Question

Find y'. y= |x + X (x) (x) X 1 02x+ 2x 1 O 2x + 1/3 Ex 2x +

Answered: 1 week ago