Question: This assignment uses eclipse Assignment 5 To create a program that uses an array: Creating and Populating an Array In this section, you will create

This assignment uses eclipseThis assignment uses eclipse Assignment 5 To create a program that uses

Assignment 5 To create a program that uses an array: Creating and Populating an Array In this section, you will create a small array step by step to see how arrays are used. The array will hold salaries for four categories of employees 1. create a ava class called DemoArrayY 2. Add the fomwing main() headers and their corresponding opening curly braces: public class DemoArray public static void main(Stringl] args) 3. On a new line, declare and create an array that can ho ld four doub valuesby typing the following: doublet] salary-new double[4]: 4. One by one, assign four values to the four salary array elements by typing the following: salary[0]6.25: salaryl1]6.55: salary[2]-10.25: salary[3116.85: 5. To confirm that the four values have been assigned, display the salaries one by one using the following code: System.out.println "Salaries one by one are:") System.out.println(salary [0]) System.out.println(salary[1]) System.out.println(salary[2]) System.out.printlnisalary[3]): 6. Add the tuo closing curly braces that end the main) method and the DemoArray class. 7. Run the program. Submit your code and the output as a Notepad attachment file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!