import java.util.Scanner; public class Salary { //Write your methods here public static void main(String[] args) { Scann
Posted: Thu May 26, 2022 9:15 am
import java.util.Scanner;
public class Salary {
//Write your methods here
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int hours;
double hourly_wage;
double weekly_salary = 0;
double monthly_salary = 0;
double yearly_salary = 0;
System.out.println("This program will calculate your weekly,
monthly "
+ "and yearly salary!");
System.out.print("Please enter your hourly wage: ");
hourly_wage = input.nextDouble();
System.out.print("Please enter the number of hours you work each
week: ");
hours = input.nextInt();
//call methods below
weekly_salary = //method call goes here
monthly_salary = //method call goes here
yearly_salary = //method call goes here
System.out.printf("You make $%.2f per week\n",
weekly_salary);
System.out.printf("You make $%.2f per month\n",
monthly_salary);
System.out.printf("You make $%.2f per year\n",
yearly_salary);
input.close();
}
}
weeklySalary():
monthlySalary():
yearlySalary():
weekly_salary = //method call goes here
monthly_salary = //method call goes here
yearly_salary = //method call goes here
Your output should look identical to the following (except user
input will vary):
This program will calculate your weekly, monthly, and yearly
salary!
Please enter your hourly wage: 15
Please enter the number of hours you work each week: 40
You make $600.00 per week.
You make $2400.00 per month.
You make $28800.00 per year.
public class Salary {
//Write your methods here
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int hours;
double hourly_wage;
double weekly_salary = 0;
double monthly_salary = 0;
double yearly_salary = 0;
System.out.println("This program will calculate your weekly,
monthly "
+ "and yearly salary!");
System.out.print("Please enter your hourly wage: ");
hourly_wage = input.nextDouble();
System.out.print("Please enter the number of hours you work each
week: ");
hours = input.nextInt();
//call methods below
weekly_salary = //method call goes here
monthly_salary = //method call goes here
yearly_salary = //method call goes here
System.out.printf("You make $%.2f per week\n",
weekly_salary);
System.out.printf("You make $%.2f per month\n",
monthly_salary);
System.out.printf("You make $%.2f per year\n",
yearly_salary);
input.close();
}
}
weeklySalary():
monthlySalary():
yearlySalary():
weekly_salary = //method call goes here
monthly_salary = //method call goes here
yearly_salary = //method call goes here
Your output should look identical to the following (except user
input will vary):
This program will calculate your weekly, monthly, and yearly
salary!
Please enter your hourly wage: 15
Please enter the number of hours you work each week: 40
You make $600.00 per week.
You make $2400.00 per month.
You make $28800.00 per year.