MISY - 3433 - Exam2 - Version - Spring 2021 To Post
MISY - 3433 - Exam2 - Version - Spring 2021 To Post
Note:
1. Write your name on your test
2. Use ECLIPE to write your code
3. Copy and paste your code in the space labeled “Your code” at the end of the test paper
4. Save your work
5. Upload your work on Canvas
6. The grading rubrics are provided in the last page of the test.
1
Version A
Write a program to compute and display the net salary of an employee, given the number of
hours worked and the hourly rate. All employees are entitled to a minimum of 40 hours (if
you work less than 40hours you are paid for 40hours). The rate for taxes varies depending of
the gross salary as follow:
Gross Salary Taxes rate
Gross salary <= 1000 1.5%
Gross salary > 1000 1.61%
Your program will prompt the user to input the data from the keyboard.
2
Version A
hourlyRate= informedHourlyRate;
numberOfhour =informedNumberOfHourlyWorked;
void computeGrossSalary()
{
if (numberOfhour>40)
{
GrossSalary= hourlyRate*numberOfhour;
}
else
{
GrossSalary=40*hourlyRate;
}
}
void computeTax()
{
if (GrossSalary<=1000)
{
Tax = 0.015* GrossSalary;
}
else
{
Tax=0.0161* GrossSalary;
}
}
void computeNetSalary()
{
NetSalary=GrossSalary-Tax;
}
double displayNetSalary()
{
return NetSalary;
}
String getName()
{
return firstName + " " +lastName;
}
}
3
Version A
/*
Nabharaj Shrestha
MISY 3433-001: Java Applications in Business
EXAM 2 Part 2
Task :- Compute and display Net Salary of Employee
*/
package Salary;
4
Version A
5
Version A
OUTPUT
6
Version A
7
Version A
Grading Rubrics
Tester Class
Input data => 10pts
Process data => 15pts
Print result => 10pts
Good Luck!!!