I need help with a JAVA program, In the program we need to create the next method. Method: End Salary This method receives the income, the benefits of a employee and a cap. Calculate and return the final income after taxes according to the following: Case 1: If the sum of income and benefits is greater than or equal to the cap, then 35% of taxes on accrued income will be paid (income + benefits) Case 2: If the sum of income and benefits is less than the cap, then 20% of taxes on accrued income will be paid Also, regardless of whether it is case 1 or case 2: if the benefits are less than half of the income, then it will add to the final income (after taxes) a 5% on that same final income The signature of the method is: Public static double salaryFinal (double salary, double benefits, double top) The main () method should print the final income of the employee.
Thank you very much.
public static double salaryFinal (double salary,
double benefits, double top){
double accruedIncome =
salary+benefits;
double finalIncome;
//If the sum of income and benefits
is greater than or equal to the cap, then 35% of taxes on accrued
income will be paid (income + benefits)
if(accruedIncome>=top){
finalIncome =
accruedIncome * 0.65;
}else{ //If the sum of income and
benefits is less than the cap, then 20% of taxes on accrued income
will be paid
finalIncome =
accruedIncome * 0.80;
}
//if the benefits are less than
half of the income, then it will add to the final income (after
taxes) a 5% on that same final income
if(benefits < salary/2){
finalIncome =
finalIncome * 1.05;
}
return finalIncome;
}
OUTCOME:

I need help with a JAVA program, In the program we need to create the next...
******** IN JAVA ********* I have a program that I need help debugging. This program should ask a user to input 3 dimensions of a rectangular block (length, width, and height), and then perform a volume and surface area calculation and display the results of both. It should only be done using local variables via methods and should have 4 methods: getInput, volBlock, saBlock, and display (should be void). I have most of it written here: import java.util.*; public class...
//please help
I can’t figure out how to print and can’t get the random numbers to
print. Please help, I have the prompt attached. Thanks
import java.util.*;
public
class
Test
{
/**
Main method */
public
static
void main(String[]
args)
{
double[][]
matrix
=
getMatrix();
//
Display the sum of each column
for
(int
col
= 0;
col
<
matrix[0].length;
col++)
{
System.out.println(
"Sum
" + col
+
" is
" +
sumColumn(matrix,
col));
}
}
/**
getMatrix initializes an...
Hi everyone! I need help on my Java assignment. I need to create a method that is called sumIt that will sum two values and will return the value.It should also invoke cubeIt from the sum of the two values. I need to change the currecnt program that I have to make it input two values from the console. The method has to be called sumIt and will return to the sum that will produce the cube of the sum...
HELLO. I'M KINDA NEW TO JAVA AND I NEED HELP WITH A METHOD. USING RECURSION ONLY. public static int sumaEnRango (int start,int end) -RECURSIVE METHOD THAT RETURNS THE SUM OF ALL THE CONSECUTIVE INTEGER NUMBERS BETWEEN "START" AND "END. IT ALSO RETURNS 0 IN CASE "START" IS GREATER THAN "END" THIS METHOD RETURNS AN ARITHMERIC EXCEPTION IN CASE THE PARAMETER NUMBER IS NEGATIVE I KNOW THIS IS SIMPLE METHOD BUT I'M STILL CONFUSED WHEN USING RECURSION. THANKS A LOT !!!
I need to create a code for this prompt: In this project we will build a generic UserInput class for getting keyboard input from the user. Implementation: The class UserInput is a 'Methods only' class, and all the methods should be declared static. Look at the TestScanner.java program at the bottom of this page that inputs a string, int and double. It shows you how to use Scanner class to get input from the keyboard. Write FOUR simple methods, one...
2. Given following Java program, convert to class diagram, create two instances of Employee, and initialize them with following values: For employee1, name – your friend’s name, salary = 30000, 8 hours and avail is false For employee2, name – your friend’s name, salary = 80000, 10 hours and avail is true public class Employee { private String name; private double salary ; private int hours ; private boolean avail ; public Employee (double r, double h, boolean hd) {...
Write a JAVA program that has a method which accepts a string and prints it back to the user with all vowels replaced with *'s (multiple asterisks not '*s') with a new line after the string. The method signature should look like this: public static void replacePrint(String input)
need help editing or rewriting java code, I have this program
running that creates random numbers and finds min, max, median ect.
from a group of numbers,array. I need to use a data class and a
constructor to run the code instead of how I have it written right
now. this is an example of what i'm being asked
for.
This is my code:
import java.util.Random;
import java.util.Scanner;
public class RandomArray {
// method to find the minimum number in...
Create a C# Using a GUI, Define a Method named CalcPay that takes as argument the hours and rate and return the gross pay, the method signature is as follow: public static double CalcPay(double hours, double rate) Take into consideration that an employee has to be paid 1.5 the rate for the hours more than 40.
I need to Write a test program that prompts the user to enter 10 double values into an array, calls a method to calculate the average of the numbers, and displays the average. Next, write a method that returns the lowest value in the array and display the lowest number. The program should then prompt the user to enter 10 integer values into an array, calculates the average, and displays the average. The program should have two overloaded methods to...