Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 eclipse
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 fileStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started