Computer Applications
Employees at Arkenstone Consulting earn the basic hourly wage of Rs.500. In addition to this, they also receive a commission on the sales they generate while tending the counter. The commission given to them is calculated according to the following table:
Total Sales | Commmision Rate |
---|---|
Rs. 100 to less than Rs. 1000 | 1% |
Rs. 1000 to less than Rs. 10000 | 2% |
Rs. 10000 to less than Rs. 25000 | 3% |
Rs. 25000 and above | 3.5% |
Write a program in Java that inputs the number of hours worked and the total sales. Compute the wages of the employees.
Java
Java Conditional Stmts
88 Likes
Answer
import java.util.Scanner;
public class KboatArkenstoneConsulting
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter number of hours: ");
int hrs = in.nextInt();
System.out.print("Enter total sales: ");
int sales = in.nextInt();
double wage = hrs * 500;
double c = 0;
if (sales < 100)
c = 0;
else if (sales < 1000)
c = 1;
else if (sales < 10000)
c = 2;
else if (sales < 25000)
c = 3;
else
c = 3.5;
double comm = c * sales / 100.0;
wage += comm;
System.out.println("Wage = " + wage);
}
}
Output
Answered By
45 Likes
Related Questions
Write a program in Java to compute the perimeter and area of a triangle, with its three sides given as a, b, and c using the following formulas:
Using the switch statement in Java, write a program to display the name of the city according to the user's choice.
D — Delhi, M — Mumbai, K — Kolkata, C — ChennaiWrite a program that will read the value of x and compute the following function:
Mayur Transport Company charges for parcels as per the following tariff:
Weight Charges Upto 10 Kg. Rs. 30 per Kg. For the next 20 Kg. Rs. 20 per Kg. Above 30 Kg. Rs. 15 per Kg. Write a program in Java to calculate the charge for a parcel, taking the weight of the parcel as an input.