Program Description
java program using the following specifications:
Declare an array named Salary type double size 10
Declare an array named Taxes type double size 10
Declare and initialize an array named Employees and initialize it to 10 names. You can also declare array Employees and enter names from Keyboard.
Enter data into array Salary
Multiply each element of array Salary by .20 and save the results in elements of array Taxes.
Find the maximum and minimum Salary.
Following is Partial Code to get you started
import java.util.Scanner;
public class YourName
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
// declaration of array Salary and Tax and Employees and variables to
//hold maximum and minimum salary
double Maximum; //variable to hold maximum salary
double Minimum; // //variable to hold minimum salary
final int LIMIT = 10 ; //declare array size as constant
final double taxRate = .20 ; // declare tax rate as constant
double[] Salary = new double[LIMIT];
double[] Taxes = new double[LIMIT];
// Array employees has been declared and initialized to 10 names
String[] Employees = {"John Anderson", "Andy Ford", " ",}; // add 8 more names
System.out.println("The size of the arrays: " + Salary.length);
// Loop to enter data into array Salary and calculate taxes
for (int index = 0; index < LIMIT; index++)
{
System.out.print("Enter Salary for employee # " + (index+1) + ": ");
Salary[index] = scan.nextDouble();
Taxes[index]=Salary[index]*. taxRate;
}
Maximum=0;
Minimum=Salary[0];
// Following loop will find the maximum and minimum salary
for (int index = 0; index < LIMIT; index++)
{
If (Salary[index])>Maximum)
Maximum=Salary[index];
If (Salary[index])<Minimum)
Minimum=Salary[index];
}
for (int i = 0; i < 10; i++)
{
//In this block code statements to display output that should look like
// the following
}
// Code java statement to Display Maximum Salary
// Code java statement to Display Minimum Salary
} End main()
} End class
sectetu
sectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet.
sectetur adipiscing eUnlock access to this and over
10,000 step-by-step explanations
Have an account? Log In
sectetur adipiscing elit. Nam lacini
sectetur adipiscing elit. Nam l