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
1. What is the difference between a group and a topic?
kap26 [50]
<h3>What is the difference between group and a topic ?</h3>

<h3>Group</h3>
  • You can publish a comment or question to the main community feed or to a group of which you are a member. Members with a common interest can form group within the wider community to form a small community around that topic and group posts will only appear in the feeds of other group members, not in the general community feed.
<h3>Topic</h3>
  • Topic work similarly to hashtags. Use the "+" symbol to the left of the Post/Ask button to add a topic (tag) to your post or question so that it can be classified along with other related posts and topics are a way to group posts and queries with similar content, but they don’t bring everyone with the same interest together in one place and this is where the groups come in!
7 0
2 years ago
Suppose a program is operating with execution-time binding and the physical address generated is 300. the relocation register is
maria [59]

The corresponding logical address is 200.

If a program is operating with execution-time binding, the physical address generated will be 300. However, if the relocation register is set to 100, the corresponding logical address will be 200.

This is because the relocation register is used to offset the physical address, so that it can be used to calculate the logical address.

Learn more here:

brainly.com/question/20355023

#SPJ4

7 0
1 year ago
A smartphone user notices that their phone gets very hot, and their battery is draining quickly. Even when the phone is in their
nika2105 [10]

Answer:

The problem would be the battery

Explanation:

The reason is becuse the battery might be bad or have a shortage in it hope this helps :) and good luck!

6 0
2 years ago
Computer programming
Svet_ta [14]
Sjanqknjwolq esjkalqlkd
5 0
2 years ago
What are two distinctive types of unmanned aircraft systems
chubhunter [2.5K]
Probes and Drones
Hope this helps and please give brainliest!
8 0
3 years ago
Other questions:
  • What folder holds 32-bit programs installed in a 64-bit installation of windows?
    12·1 answer
  • Can someone please give me a good definition to audience expectations!<br> (in film)
    8·1 answer
  • If you think a query is misspelled, which of the following should you do?
    15·1 answer
  • How to select the entire table in microsoft excel
    11·1 answer
  • How is DATA sent across a Network?
    7·1 answer
  • Muultimedia Promo try answer this question and explaining them or give examples of that topic Thanks
    10·1 answer
  • Which type of loan is based on financial need
    6·1 answer
  • What does Stand for in web design
    9·1 answer
  • A parent process calling _____ system call will be suspended until children processes terminate.
    14·1 answer
  • The concepts of ________________, _________________, and _________________ for covert acts are pivotal to understanding state-on
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!