0% found this document useful (0 votes)
3 views2 pages

Java Salary Calculator Program

This Java code defines two classes, Compute and Employed, and contains a main method to prompt a user for their name, address, job, salary, and hours worked. It then calculates and prints the user's salary per hour by dividing their salary by hours worked using the getVolume() method in the Compute class.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Java Salary Calculator Program

This Java code defines two classes, Compute and Employed, and contains a main method to prompt a user for their name, address, job, salary, and hours worked. It then calculates and prints the user's salary per hour by dividing their salary by hours worked using the getVolume() method in the Compute class.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Francisco Charl Campos III

BAIT-1E

Codes:

package [Link];

import [Link];

class Compute
{
double salary= 20000;
double hours= 80;
double getVolume(){
return salary/hours;
}
}
class Employed
{
String name;
String address;
String job;
}
public class comp {
public static void main(String[]args){

Scanner a = new Scanner([Link]);


Compute comp = new Compute();
Employed emp = new Employed();
[Link] = "";
[Link] = "";
[Link] = "";
[Link]("Enter your Name:");
[Link] = [Link]();
[Link]("Enter your Adress:");
[Link] = [Link]();
[Link]("Enter your Job:");
[Link] = [Link]();

[Link] = 20000;
[Link] = 80;
[Link]("Enter your Salary:");
[Link] = [Link]();
[Link]("Enter your Working Hours:");
[Link] = [Link]();
[Link]("Salary per Hour:" +[Link]());
[Link]= [Link]();

}
}
Output:

You might also like