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
Multiple Choice
Maurinko [17]

Answer:

dont do more then you handle

8 0
3 years ago
What is the opportunity cost of computers when moving from point A to point B? -15 DVDs b. What is the opportunity cost of compu
oee [108]

Answer:

Increasing

Explanation:

Generally in economics, opportunity cost is the benefit that a person, a business, or an investor forgo or missed when he chooses one alternative instead of the other.

Under production, opportunity cost occurs when a producer sacrifice the production of one for the production of another good. Using good X and Y as examples, opportunity cost is measured by the number of units of good Y that the producer gives up in order to produce one or more units of good X.

In the question, the two products used are computers and DVD. The -15, -18 and -20 implies that producing an extra unit of computer by moving from point A to point B, point B to C, and point C to D, 15, 18 and 20 units of DVD respectively have to be given up.

Since 20 is greater than 18 and 18 is also greater than 15, it therefore implies as we produce more computers, the opportunity cost, which are the number of DVDs given up at each point, are increasing.

I wish you the best.

5 0
3 years ago
Select the correct answer.
MrRissso [65]

Answer:

Pie Chart

Explanation:

8 0
3 years ago
Read 2 more answers
Html version ____ added support for style sheets to give web designers greater control over page layout and appearance.
galina1969 [7]
I believe it was HTML4.




____________________
3 0
3 years ago
Tanner has had many different jobs. He previously designed the playscape at the local park with natural rocks, creeks, and veget
zavuch27 [327]
I think it would be Design. 
3 0
3 years ago
Read 2 more answers
Other questions:
  • If you're found to be at fault in _____, your driver license will be canceled within 90 days unless you complete a 12-hour Advan
    10·2 answers
  • *Could someone please help me with this***
    5·1 answer
  • Which of the following protocols is used to unsure secure transmissions on port 443?A. HTTPSB. TelnetC. SFTPD. SHTTP
    6·1 answer
  • Physical activity such as sports or even a brisk walk can help reduce
    7·2 answers
  • What’s the best description of an opportunity cost
    5·1 answer
  • How to make a Tip Calculator in code?
    12·1 answer
  • Select the correct answer.
    6·2 answers
  • in a deisgn project, what two types of graphics or images is the digital artist respondsible for creating?
    11·1 answer
  • A computer follows step-wise instructions to complete any task which is known as?
    5·1 answer
  • If you are going to develop a special computer, what would it be and explain it's purpose.​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!