1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
pickupchik [31]
3 years ago
15

Understanding Sequential Statements Summary

Computers and Technology
1 answer:
Kisachek [45]3 years ago
8 0

Answer:

// Payroll.java

public class Payroll

{

int numOfDependents;

double salary;

double salaryToHome;

double Federal_Tax,TAX_RATE,Depen_tax;

 

Payroll(double salry,int nod)

{

numOfDependents=nod;

salary=salry;

Federal_Tax=6.5;

TAX_RATE=28.0;

Depen_tax=2.5;

}

 

double getTAX_RATE()

{

return TAX_RATE*salary/100;

}

double Federal_Tax()

{

return Federal_Tax*salary/100;

}

double getDepenAmount()

{

return numOfDependents*(Depen_tax*salary/100);

}

double getTakeHomeSalary()

{

return salary+getDepenAmount()-(getTAX_RATE()+Federal_Tax());

}

void printOutput()

{

System.out.print("\nState Tax: $"+getTAX_RATE());

System.out.print("\nFederal Tax: $"+Federal_Tax());

System.out.print("\nDependents: $"+getDepenAmount());

System.out.print("\nSalary: $"+salary);

System.out.println("\nTake Home Pay: $"+getTakeHomeSalary());

 

}

public static void main(String args[])

{

Payroll obj=new Payroll(1250,2);

obj.printOutput();

}

}

// ModifiedPayroll.java

import java.util.Scanner;

public class ModifiedPayroll

{

 

int numOfDependents;

double salary;

double salaryToHome;

double Federal_Tax,TAX_RATE,Depen_tax;

 

ModifiedPayroll(double salry,int nod)

{

//initialise variables

numOfDependents=nod;

salary=salry;

Federal_Tax=6.5;

TAX_RATE=28.0;

Depen_tax=2.5;

}

 

double getTAX_RATE()

{

return TAX_RATE*salary/100;

}

double Federal_Tax()

{

return Federal_Tax*salary/100;

}

double getDepenAmount()

{

return numOfDependents*(Depen_tax*salary/100);

}

double getTakeHomeSalary()

{

return salary+getDepenAmount()-(getTAX_RATE()+Federal_Tax());

}

void printOutput()

{

System.out.print("\nState Tax: $"+getTAX_RATE());

System.out.print("\nFederal Tax: $"+Federal_Tax());

System.out.print("\nDependents: $"+getDepenAmount());

System.out.print("\nSalary: $"+salary);

System.out.println("\nTake Home Pay: $"+getTakeHomeSalary());

 

}

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

System.out.print("\nEnter Salary: $");

double salary=sc.nextDouble();

System.out.print("\nEnter number Of Dependents:$");

int nob=sc.nextInt();

ModifiedPayroll obj=new ModifiedPayroll(salary,nob);

obj.printOutput();

}

}

Explanation/Output:

// For Payroll.java

State Tax: $350.0

Federal Tax: $81.25

Dependents: $62.5

Salary: $1250.0

Take Home Pay: $881.25

// For ModifiedPayroll.java

Enter Salary:$1550.0

Enter number of Dependents:$3

State Tax: $434.0

Federal Tax: $100.75

Dependents: $116.25

Salary: $1550.0

Take Home Pay: $1131.5

You might be interested in
An online travel agency such as Travelocity is an example of a(n) _____.
dezoksy [38]

An online travel agency such as Travelocity is an example of a intermediary.

3 0
2 years ago
project-1 Write a class called Person that has two data members - the person's name and age. It should have an init method that
MArishka [77]
Hello how are you today
4 0
3 years ago
Convert decimal number 262 to an octal number.
liberstina [14]

Answer:

406.

Explanation:

continuously dividing the base 10 or decimal number by 8 till the decimal number does not becomes zero and the result is the remainders in reverse.  

Remainder on 262 / 8 = 6.  

Remainder on 32 / 8 = 0.  

Remainder on 4 / 8 = 4.  

Octal number=406.

8 0
3 years ago
Helpppppp please I will give branliest or something please help ​
Allisa [31]

OK you don't be sad it is always free

7 0
2 years ago
We can successfully manage influences in our lives by
Natalija [7]

Answer:

D

Explanation:

8 0
3 years ago
Other questions:
  • Credit card numbers follow a standard system. For example, Visa, MasterCard, and Discpver Card all have 16 digits, and the first
    11·1 answer
  • The function below takes a single parameter number_list which is a list that can contain integers and floats. Complete the funct
    9·1 answer
  • Carlos own a hardware store.He currently is not using any software to track what he has in the store. .In one to two sentences,
    10·1 answer
  • how to make assignment on power point plz cntct me and help me all about power point and my assignment is prime ministers of pak
    13·1 answer
  • Help please fast
    6·2 answers
  • The _______ "represents a set of features that enables the user to inform himself whether a security feature is in operation or
    8·1 answer
  • I want to solve this question in C program, Please.
    7·1 answer
  • C program how to input this? ​
    11·1 answer
  • A data analyst adds descriptive headers to columns of data in a spreadsheet. How does this improve the spreadsheet?.
    8·1 answer
  • The ________ approach to motivation suggests a connection between internal physical states and outward behavior. achievement dri
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!