do while loop to repeat your program, 2. while loop to validate your input (hours and rate must be greater than 0) 3. apply printf statement for your output ===================================== Write a java program to calculate the gross, fed tax, state tax, and net for a number of employees. your input is: First name, Middle initial, Last name, Id number, hours worked, rate per hour. assume the Fed tax percentage is 12%, state tax per 7%. <=== declare as a constant formulas : Gross = hours worked * rate per hour Fed Tax = Gross * Fed tax percentage State Tax = Gross * State tax percentage Net = Gross- (State Tax + Fed Tax) Calculate the gross total (sum of gross for all employees) Calculate the gross average (gross total/number of employees) Display in this format: First Name: Middle Initial: Last Name: Id Number: Hours worked: Rate Per Hour : Fed Tax: State Tax: Gross : Net ================== ======= ================ ======== ===== ====== ==== === NOTE: DO NOT ASK THE USER for the number of the employees and do not hard code the number of employees in your program Submit: Design (pseudo code) Source code (java program) Output (word, jpeg, or pdf file) ADD COMMENTS
Types of Loop
Loops are the elements of programming in which a part of code is repeated a particular number of times. Loop executes the series of statements many times till the conditional statement becomes false.
Loops
Any task which is repeated more than one time is called a loop. Basically, loops can be divided into three types as while, do-while and for loop. There are so many programming languages like C, C++, JAVA, PYTHON, and many more where looping statements can be used for repetitive execution.
While Loop
Loop is a feature in the programming language. It helps us to execute a set of instructions regularly. The block of code executes until some conditions provided within that Loop are true.
1. do while loop to repeat your program,
2. while loop to validate your input (hours and rate must be greater than 0)
3. apply printf statement for your output
=====================================
Write a java program to calculate the gross, fed tax, state tax, and net for a number of employees.
your input is:
First name, Middle initial, Last name, Id number, hours worked, rate per hour.
assume the Fed tax percentage is 12%, state tax per 7%. <=== declare as a constant
formulas :
Gross = hours worked * rate per hour
Fed Tax = Gross * Fed tax percentage
State Tax = Gross * State tax percentage
Net = Gross- (State Tax + Fed Tax)
Calculate the gross total (sum of gross for all employees)
Calculate the gross average (gross total/number of employees)
Display in this format:
First Name:
Middle Initial:
Last Name:
Id Number:
Hours worked:
Rate Per Hour :
Fed Tax:
State Tax:
Gross :
Net
================== ======= ================ ======== ===== ====== ==== ===
NOTE: DO NOT ASK THE USER for the number of the employees and do not hard code the number of employees in your program
Submit:
Design (pseudo code)
Source code (java program)
Output (word, jpeg, or pdf file)
ADD COMMENTS
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images