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
Jabari created new video game for his coding course. What is one way he should format his pseudocode?
AleksAgata [21]

Answer:

Last one is the only logical one.

Explanation:

Hope this helps!!!

8 0
3 years ago
If you want to selectively darken an area of an image you could use the
DerKrebs [107]
Create an adjustment layer and create a hue and saturation layer. You'll see sliders so adjust them to your liking. next select a layer mask and fill it will black. then select which areas you want to darken and use the wand tool. Apply a gradient mask if you want. 
5 0
3 years ago
If you are Rich In adopt me friend me And give me pets Please
Svetllana [295]

Answer:

Thanks but I don't want to give my pets there're all legendary

Explanation:

7 0
3 years ago
Read 2 more answers
Which of the following statements is true?
Luden [163]

Answer:

Option (A) int expressions are always computed exactly; but float expressions can suffer round-off error.

Explanation:

Round - Off Error can be defined as the digital computers have limitations on denoting the decimal numbers,  due to this the floating point numbers have to be rounded off or even it is represented exactly after the calculation on the numbers the resulting number has to be adjusted / rounded off according to the specified precision. The resulted number has to be rounded off back to the required precision, this leads to the round off errors in digital computers. As integers don't need to go through the rounding off in computers, the integer numbers don't have round off errors, only floating point numbers have round off errors. So, options (B) , (C) and (D) are false.

6 0
3 years ago
The __________ River is Europe’s longest river.
MariettaO [177]

Answer:

<h3>The Volga river is Europes longest river.</h3><h2>HOPE IT HELPS</h2>
6 0
2 years ago
Read 2 more answers
Other questions:
  • "Which of the following will help protect against a brute force attack?
    11·1 answer
  • How do i start makeing a Character in the Unreal Game Engine
    14·2 answers
  • Create a program that reads words.txt (link near top of our home page) in order to: determine the length of the longest word(s)
    14·1 answer
  • You use Cat5e twisted pair cable on your network. Cables are routed through walls and the ceiling. A user puts a screw in the wa
    9·1 answer
  • The most widely used presentation software program is Microsoft PowerPoint. You can produce a professional and memorable present
    14·1 answer
  • Study the sentences below. A.Changing the properties of characters in a sentence or paragraph in a Word document helps increase
    5·2 answers
  • What is true about super computers?
    15·1 answer
  • 5. The command to add new layout to the slide is present in<br>tab.​
    15·1 answer
  • Directions: Give the shortcut key for the following commands: 1. Open 2. Save 3. New document 4. Copy 5. Undo 6. Redo 7. Paste 8
    5·1 answer
  • is a programming model that focuses on an application's components and data and methods the components use. Group of answer choi
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!