Question
Create an Eclipse Java project called Salary, with a Java class called Salary. 1. Copy and paste the following code, compile and run the program
Create an Eclipse Java project called Salary, with a Java class called Salary. 1. Copy and paste the following code, compile and run the program to test it. 2. Change the salary variable wherever it exists to grossPay. 3. Add a variable to store taxRate (use camelCasing when creating variables that are compound words, i.e. twoOrMoreWords. 4. Display the salary before taxes (as shown). 5. Create a variable with the appropriate data type and compute taxAmount as a dollar value. 6. Create a variable to store net pay. 7. Display the taxAmount, taxRate, and net pay. 8. Add appropriate comments including a single line comment with your name Written by Your Name. Also, add a multi-line comment with identifying information
// Starting Code: public class Salary { public static void main (String [] args) { // declare variables double wage=12.50; int hours = 20; int weeks = 52; double salary=0.0; // generate messages System.out.println("Salary Calculator Program"); System.out.print("Your Annual Salary is: "); // perform calculations salary = wage * hours * weeks; System.out.println(salary); System.out.println( **** End of Program ****); return; } }
Step 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