Computer Science, asked by hazellighte888, 10 months ago

write a program to create a class employee and input the number of days work and wages per day and 10% increment of total wages to be paid and display the final amount to be paid in Java bluej
Please answer me fast it's urgent!!!

Answers

Answered by premsree96
0

import java.io.*;

class Employee

{

int days;

double wages_per_day;

double total_wages;

double increment;

double final_amount;

void getData() throws IOException

{

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

System.out.print("Enter no:of days worked : ");

days = Integer.parseInt(br.readLine());

System.out.print("Enter wages per day : ");

wages_per_day = Double.parseDouble(br.readLine());

}

double getFinalAmount()

{

total_wages = days*wages_per_day;

increment = 0.1*total_wages;

final_amount = total_wages + increment;

return final_amount;

}

public static void main(String args[])throws IOException

{

Employee employee = new Employee();

employee.getData();

System.out.println("Final Amount = "+employee.getFinalAmount());

}

}

//end of program

sample output

Enter no:of days worked : 10

Enter wages per day : 100

Final Amount = 1100.0

Similar questions