?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Moderate

Calculate Net Salary Method

APCSA-BEY6JE

A programmer is asked to create a method to calculate the net salary for an employee’s pay stub. The gross salary, tax rate and other deductions are needed to calculate the net salary.

What would be an appropriate method signature for this method?

A
public static int calcNetSalary(int gross, int taxRate, 
                                int deductions)
B
public static int calcNetSalary(double gross, double taxRate, 
                                double deductions)
C
public static double calcNetSalary(double gross, double taxRate,
                                   double deductions)
D
public static double calcNetSalary(double gross, int taxRate, 
                                   double deductions)
E
public static void calcNetSalary(int gross, int taxRate, 
                                 int deductions)