Write a program that does the following in order:
1. Asks the user to enter a name
2. Asks the user to enter a number "gross income"
3. Asks the user to enter a number "state tax rate"
4. Calculates the "Federal Tax". "FICA tax" and "State tax"
5. Calculates the "estimated tax" and round the value to 2 decimal places
6. Prints values for "name", "gross income" and "estimated tax"
The program should contain three additional variables to store the Federal tax, FICA tax, State tax, gross income, and estimated tax.
Federal Tax = gross income * 9.45%
FICA Tax = gross income * 7.65%
State Tax = gross income * your state tax percent
Estimated Tax = Federal tax + FICA tax + State tax
NOTE: Percentages must be converted to decimal values, for example:
15.9%=15.9*0.01=0.159
An example of the program's input and output is shown below:
Enter your name: Belinda Patton
Enter your gross income: 53398.12
Enter your state income tax rate: 4.27
Belinda Patton's estimated tax is $11411.08 based on a gross income of $53398.12

Answers

Answer 1

Answer:

import java.util.Scanner;

import java.math.BigDecimal;

import java.math.RoundingMode;

public class TaxCalculator {

   public static void main(String[] args) {

       Scanner scanner = new Scanner(System.in);

       System.out.print("Enter your name: ");

       String name = scanner.nextLine();

       System.out.print("Enter your gross income: ");

       BigDecimal grossIncome = scanner.nextBigDecimal();

       System.out.print("Enter your state tax rate (%): ");

       BigDecimal stateTaxRate = scanner.nextBigDecimal();

       scanner.close();

       BigDecimal federalTaxRate = new BigDecimal("9.45");

       BigDecimal ficaTaxRate = new BigDecimal("7.65");

       BigDecimal federalTax = grossIncome.multiply(federalTaxRate.divide(BigDecimal.valueOf(100)));

       BigDecimal ficaTax = grossIncome.multiply(ficaTaxRate.divide(BigDecimal.valueOf(100)));

       BigDecimal stateTax = grossIncome.multiply(stateTaxRate.divide(BigDecimal.valueOf(100)));

       BigDecimal estimatedTax = federalTax.add(ficaTax).add(stateTax);

       estimatedTax = estimatedTax.setScale(2, RoundingMode.HALF_UP);

       System.out.println("Name: " + name);

       System.out.println("Gross Income: $" + grossIncome);

       System.out.println("Estimated Tax: $" + estimatedTax);

   }

}

Explanation: When working with financial values it is highly recommended to use BigDecimal instead of a regular float or double to ensure there are no floating point precission issues.

Answer 2

Answer:

import java.util.Scanner;

import java.math.BigDecimal;

import java.math.RoundingMode;

public class TaxCalculator {

  public static void main(String[] args) {

      Scanner scanner = new Scanner(System.in);

      System.out.print("Enter your name: ");

      String name = scanner.nextLine();

      System.out.print("Enter your gross income: ");

      BigDecimal grossIncome = scanner.nextBigDecimal();

      System.out.print("Enter your state tax rate (%): ");

      BigDecimal stateTaxRate = scanner.nextBigDecimal();

      scanner.close();

      BigDecimal federalTaxRate = new BigDecimal("9.45");

      BigDecimal ficaTaxRate = new BigDecimal("7.65");

      BigDecimal federalTax = grossIncome.multiply(federalTaxRate.divide(BigDecimal.valueOf(100)));

      BigDecimal ficaTax = grossIncome.multiply(ficaTaxRate.divide(BigDecimal.valueOf(100)));

      BigDecimal stateTax = grossIncome.multiply(stateTaxRate.divide(BigDecimal.valueOf(100)));

      BigDecimal estimatedTax = federalTax.add(ficaTax).add(stateTax);

      estimatedTax = estimatedTax.setScale(2, RoundingMode.HALF_UP);

      System.out.println("Name: " + name);

      System.out.println("Gross Income: $" + grossIncome);

      System.out.println("Estimated Tax: $" + estimatedTax);

Explanation: When working with financial values it is highly recommended to use Big Decimal instead of a regular float or double to ensure there are no floating point precission issues.


Related Questions

Write a program that uses two input statements to get two words as input. Then, print the words on one line separated by a space. Your program's output should only include the two words and a space between them.

Hint: To print both words on one line, remember that you can concatenate (add) two phrases by using the + symbol. Don't forget that you'll need to add a space between the words as well.

Sample Run

Enter a word: Good
Enter a word: morning
Good morning

Answers

word1 = input("Enter a word: ")

word2 = input("Enter a word: ")

print(word1 + " " + word2)

I hope this helps!

What is the default layout position for images added to a Word 2016 document?

A) square, where the text wraps around an image around a square border
B) through, where the text wraps around an image with irregular borders
C) in front of the text, where the image is placed over the text
D) in-line, with the text where the text stays with the image

Answers

Answer:

D

Explanation:

Hope it works

Answer:

D) in-line, with the text where the text stays with the image

Explanation:

Just did it in ED.

The up address and the port are both numbers. Which statement is true?

Answers

The statement "The IP address and the port are both numbers" is true.

In computer networking, an IP (Internet Protocol) address is a unique numerical identifier assigned to each device connected to a computer network. IP addresses are typically represented as a series of four numbers separated by periods, such as 192.168.0.1.

Similarly, a port number is a numeric identifier used to specify a particular process or service running on a device within a network. Port numbers range from 0 to 65535 and are used to facilitate communication between different applications or services on a network.

Learn more about IP address, here:

https://brainly.com/question/18722788

#SPJ1

Plzzzz help!!!!!!!!!!!!

a sensor that stop a machine if a door is opened is an example of a

a.barrier interlock

b.guard interlock

c.electrical interlock

d.mechanical interlock

Answers

B . Guard interlock is the answer

Answer:

B. Guard interlock

Explanation:

I took a quiz on this earlier

brainiest please

how do i solve this. step by step

how do i solve this. step by step

Answers

The table of values of the kids name and the ages, hat and animal when completed is shown below

Completing the table of values

Based on the given information, we can make the following deductions:

Only the 10.year old kid has the same initial in his/her name and in his/her beloved animal

So, we have

Gorilla  -  Gabriel or

Lion -  Lucas

Gabriel either has a green hat or loves the gorilla

So, we have

Gabriel -- Green or Gorilla

Lion -  Lucas

The crocodile is either Zaira's favorite, or the kid with the white hat's favorite.

This means that

Zaira --- Crocodile or White hat --- Crocodile

Neither Gabriel nor Lucas are 12

Gabriel -- 11 or 13

Gabriel is 1 year older than the kid with the red hat and Neither of them love the zebra

This means that

Red hat --- 12

Gabriel -- Green or Gorilla -- 13

So, we have the following:

Kid's Age Kid's Name Hat Color Favorite Animal

13                    Gabriel         Green           Lion

10                      Zaira        White       Crocodile

12                          Lucas       Red                      Lion

11                   Charlotte  Blue           Zebra

Read more about pattern at

https://brainly.com/question/17386984

#SPJ1

A cyberbully is someone who invades another person's privacy by
-posting mean spirited messages
.-repeatedly sending text messages
-visiting questionable websites
-stealing original work

Answers

Although “stealing original work” sounds correct, the answer must be “repeatedly sending text messages”

Answer:

A. Posting mean-spirited messages

Explanation:

Got it right on Edg, 2021

A cyberbully is someone who invades another person's privacy by -posting mean spirited messages .-repeatedly

Robyn needs to ensure that a command she frequently uses is added to the Quick Access toolbar. This command is not found in the available options under the More button for the Quick Access toolbar. What should Robyn do?

Access Outlook options in Backstage view.
Access Outlook options from the Home tab.
Access Quick Access commands using the More button.
This cannot be done.

Answers

Access Outlook options in Backstage view

Use do while loop to find square root of odd number 1 to 200​

Answers

Here's an example of using a do-while loop in Python to find the square root of odd numbers from 1 to 200:

```
import math

i = 1

# loop through odd numbers from 1 to 200
while i <= 200:
# check if number is odd
if i % 2 != 0:
# find square root using math.sqrt() function
sqrt_i = math.sqrt(i)
print("The square root of", i, "is", sqrt_i)
i += 1
```

This code uses a while loop to iterate through the odd numbers from 1 to 200. It checks if each number is odd using the modulus operator `%`. If the number is odd, it calculates the square root using the `math.sqrt()` function and prints the result. The loop then continues to the next odd number until it reaches 200.

What type of result does the MATCH function, when used on its own, return?

Answers

Answer:

It returns the lookup value located in a specific location.

Explanation:

Create a query that lists the total outstanding balances for students on a payment plan and for those students that are not on a payment plan. Show in the query results only the sum of the balance due, grouped by PaymentPian. Name the summation column Balances. Run the query, resize all columns in the datasheet to their best fit, save the query as TotaiBalancesByPian, and then close it.

Answers

A query has been created that lists the total outstanding balances for students on a payment plan and for those students that are not on a payment plan.

In order to list the total outstanding balances for students on a payment plan and for those students that are not on a payment plan, a query must be created in the database management system. Below are the steps that need to be followed in order to achieve the required output:

Open the Microsoft Access and select the desired database. Go to the create tab and select the Query Design option.A new window named Show Table will appear.

From the window select the tables that need to be used in the query, here Student and PaymentPlan tables are selected.Select the desired fields from each table, here we need StudentID, PaymentPlan, and BalanceDue from the Student table and StudentID, PaymentPlan from PaymentPlan table.Drag and drop the desired fields to the Query Design grid.

Now comes the main part of the query that is grouping. Here we need to group the total outstanding balances of students who are on a payment plan and who are not on a payment plan. We will group the data by PaymentPlan field.

The query design grid should look like this:

Now, to show the query results only the sum of the balance due, grouped by PaymentPlan, a new column Balances needs to be created. In the field row, enter Balances:

Sum([BalanceDue]). It will calculate the sum of all balance dues and rename it as Balances. Save the query by the name TotalBalancesByPlan.Close the query design window. The final query window should look like this:

The above image shows that the balance due for Payment Plan A is $19,214.10, while for Payment Plan B it is $9,150.50.

Now, in order to resize all columns in the datasheet to their best fit, select the Home tab and go to the Formatting group. From here select the AutoFit Column Width option.

The final output should look like this:

Thus, a query has been created that lists the total outstanding balances for students on a payment plan and for those students that are not on a payment plan.

For more such questions on query, click on:

https://brainly.com/question/30622425

#SPJ8

How technology works?

Answers

First of all, technology refers to the use of technical and scientific knowledge to create, monitor, and design machinery. Also, technology helps in making other goods.

a democratic government has to respect some rules after winning the elections. Which of these points is not a part of those rules

Answers

After coming to power, a democratic administration is bound to follow certainrules and regulations. And Office-bearers are not accountable is not a part of those   rules.

How is this so?

In a democratic administration,office-bearers are indeed accountable as they are bound by rules and regulations.

The accountability ensures transparency,ethical conduct, and adherence to the principles of democracy.

Office-bearers are expected to uphold the laws and serve the interests of the people they represent.

Learn more about  democratic administration at:

https://brainly.com/question/31766921

#SPJ1

The role of ICT In government.

Answers

Answer:Communication between a government and its citizens can happen in real-time since messages are delivered instantaneously.

E-Government uses ICT for the development of more efficient and more economical government.

Explanation:

Emanuel studies hard for hours on end until bedtime, yet his grades could be better. What can he do to improve his academic performance?

sleep less
take breaks
eat more
work longer

Answers

Emanuel needs to Take breaks

Answer:

Its B! I know I'm late but for the other people that might get the same question like me.

The Finder can be used to _____.

locate files
open applications
delete files
empty the Trash
turn off the computer
organize computer folders and files

Answers

Answer:

locate files

Explanation:

sana mka tulong

keep safe

Qa Defind Networking and its importance to an organization. ​

Answers

Networking is crucial for an organization as it enables effective communication, collaboration and resource sharing among employees and external stakeholders.

Why is networking important for organizational success?

Networking plays a vital role in organizational success by fostering connections and facilitating the flow of information and resources. It allows employees to collaborate, share knowledge, and leverage each other's expertise leading to increased productivity and innovation.

But networking extends beyond the organization, enabling partnerships, customer acquisition, and business opportunities. By establishing a robust network, organizations can tap into a diverse pool of talents, stay updated with industry trends and build a strong reputation within their respective sectors.

Read more about Networking

brainly.com/question/1326000

#SPJ1

What is your favorite LEGO set

Answers

Answer:

star wars death star....

i like any of them they are all so cool lol

in the situation above, what ict trend andy used to connect with his friends and relatives​

Answers

The ICT trend that Andy can use to connect with his friends and relatives​ such that they can maintain face-to-face communication is video Conferencing.

What are ICT trends?

ICT trends refer to those innovations that allow us to communicate and interact with people on a wide scale. There are different situations that would require a person to use ICT trends for interactions.

If Andy has family and friends abroad and wants to keep in touch with them, video conferencing would give him the desired effect.

Learn more about ICT trends here:

https://brainly.com/question/13724249

#SPJ1

Which function converts the users input to a number without a decimal?

Answers

Answer:

Explanation: integer is the meaning of int() if you payed attention to programming class, int() would be a WHOLE number and not a decimal number, 2nd of all, a decimal number would be float() so the answer is int() hope i helped!

Explanation:

hope this helped byyyyyyyyyyye

The seasonal product team needs a vendor who can quickly adjust to changes in product demand. The planning team has sent over a table comparing how the four available vendors have been performing. Can you identify which vendor to recommend? Rank order the vendors, keeping the seasonal product teams needs in mind

Answers

Based on the question, the vendor to recommend is known to be "V."

Why choose vendor V?

Note that the objective of the seasonal team is to makes sure that there is the availability of goods as and when needed and in the right quantities, and as such, the vendor need to have

(i) flexibility to make changes in product demand.

(ii) fewer issues from the side of the customer

(iii) above average rating in product shipping

(iv) to get the products shipped on time.

When you Analyze all of the vendor, the option that rank higher is Vendor  V because: Vendor V  is one who is moderate flexibility and customer issues, has an increasing rate  of 10% and others.

The vendors V, K, P, and D are known to be ranked in orders as 1,2,3 and 4, respectively.

Hence, Based on the question, the vendor to recommend is known to be "V."

Learn more about vendor  from

https://brainly.com/question/25946259

#SPJ1

Correct question:  

The Seasonal Product Team needs a vendor who can quickly adjust to changes in product demand. The Planning Team has sent over a table comparing how the four available vendors have been performing. Can you identify which vendor to recommend?


By itself, the human eye cannot see anything in three dimensions. What does the passage say enables us to see the world in 3-D?

Answers

Answer:

he miracle of our depth perception comes from our brain's ability to put together two 2D images in such a way as to extrapolate depth. This is called stereoscopic vision.

Explanation:

Answer:

the way our brain and eyes work together

Explanation:

Describe how being a global citizen in the world of advanced technology can be beneficial to your success in meeting your personal, academic, and professional goals.

Answers

Answer:

well you could have more options of careers and more possibilities, online jobs can pay more and give more experience to the employees

Use the drop-down menus to complete statements about how to use the database documenter

options for 2: Home crate external data database tools

options for 3: reports analyze relationships documentation

options for 5: end finish ok run

Use the drop-down menus to complete statements about how to use the database documenteroptions for 2:

Answers

To use the database documenter, follow these steps -

2: Select "Database Tools" from   the dropdown menu.3: Choose "Analyze"   from the dropdown menu.5: Click on   "OK" to run the documenter and generate the desired reports and documentation.

How is this so?

This is the suggested sequence of steps to use the database documenter based on the given options.

By selecting "Database Tools" (2), choosing "Analyze" (3), and clicking on "OK" (5), you can initiate the documenter and generate the desired reports and documentation. Following these steps will help you utilize the database documenter effectively and efficiently.

Learn more about database documenter at:

https://brainly.com/question/31450253

#SPJ1

mpressed files have the
A. .exe
C. .sit
Save Answer
file extension.
B. .arc
D. .zip

Answers

Answer:  D. .zip

Explanation:

How can knowledge management systems help an organization increase profits and reduce costs?

Answers

Answer:

A powerful knowledge management system will allow you to organise product information. Not only this, but it should also help customers and employees access these details easily. ... Having good knowledge management and sharing practices can boost productivity and cut expenses in different areas.Jun 14, 2019

Drag the tiles to the correct boxes to complete the pairs.
Match each task to the type of control structure represents.
switch case
sequence
repetition
if else
assembling structure step by step
choosing between two subjects
selecting a color out of five colors
testing a product until free of bugs

Answers

Answer:

A structure choosing between two subjects - Switch case sequence

Selecting a color out of five colors - If else assembling

Testing a product until free of bugs - Repetition

Write a non-stop multi-function program to do the following taks:
1. Function Program to find the future value given present value, interest rate and duration in years.
2. Function program to generate a list of prime numbers starting from 1 to n.
3. Function program to generate a list of palindrome numbers starting from 10 to n.
4. Quit the program
Write Code C programming

Answers

#include#include#includevoid findFutureValue(float presentValue, float interestRate, int durationInYears){

float futureValue = presentValue * pow((1 + interestRate), durationInYears);

printf("The future value is: %.2f", futureValue);

}

int isPrime(int num){

int i;

for(i = 2; i <= num/2; ++i){ if(num%i == 0){ return 0;

}

}

return 1;

}

void generatePrimes(int n){

int i, j;

printf("The prime numbers between 1 and %d are: ", n);

for(i = 2; i <= n; ++i){ if(isPrime(i)){ printf("%d ", i);

} }}

int isPalindrome(int num){ int temp, remainder, reverse = 0; temp = num;

while(temp != 0){ remainder = temp % 10;

reverse = reverse * 10 + remainder;

temp = temp / 10;

}

if(reverse == num){ return 1;

}

else{ return 0;

}}

void generatePalindromes(int n){

int i;

printf("The palindrome numbers between 10 and %d are: ", n);

for(i = 10; i <= n; ++i){

if(isPalindrome(i)){ printf("%d ", i);

} }}

int main(){

int choice, n;

float presentValue, interestRate;

int durationInYears;

do{ printf("\nEnter your choice:");

printf("\n1. Find future value given present value, interest rate and duration in years");

printf("\n2. Generate a list of prime numbers from 1 to n");

printf("\n3. Generate a list of palindrome numbers from 10 to n");

printf("\n4. Quit the program");

printf("\nChoice: ");

scanf("%d", &choice); switch(choice){

case 1: printf("\nEnter present value: ");

           scanf("%f", &presentValue);

           printf("\nEnter interest rate: ");

           scanf("%f", &interestRate);

           printf("\nEnter duration in years: ");

           scanf("%d", &durationInYears);

           findFutureValue(presentValue, interestRate, durationInYears);

           break;

case 2: printf("\nEnter n: ");

            scanf("%d", &n);

            generatePrimes(n);

            break;

case 3: printf("\nEnter n: ");

            scanf("%d", &n);

            generatePalindromes(n);

            break;

case 4: printf("\nQuitting the program. Goodbye!");

            break;

default: printf("\nInvalid choice. Please try again.");

}}while(choice != 4); return 0;

}

For more such questions on float, click on:

https://brainly.com/question/29720774

#SPJ8

I hope The characters That I want in Mortal kombat 12 is Lori and peron That’s My character wishlist in The next Mortal kombat game To be in The roster

Answers

Answer:

not sure how to answer but cool bro

Explanation:

The memory hierarchy of a computer system organizes storage by using small, fast, expensive memories at the top of the hierarchy and supplementing them with larger, slower, cheaper memories at each successive level. Explain how the principle of memory locality makes such a system capable of providing efficient access to the data and instructions needed for executing programs.

Answers

Answer:

Following are the responses to this question:

Explanation:

The computer system's memory hierarchy arranges space through tiny, fast, costly stocks only at top of the pyramid and complements them through big, lighter, cheap storage facilities at every representation made. It is needed to limit the time for data access for application executes. A very design of the main memory allows a system to have easy access to the information and instructions necessary to execution time. A traditional technique of system memory works like:

\(Level\ 0 (Top Level) \to CPU \ Registers\\\\Level \ 1 \to Cache\ Memory \ (SRAMs)\\\\Level\ 2 \to Main \ Memory \ (DRAMs)\\\\Level \ 3 \to Magnetic \ Disk\ (Disk \ Storage)\\\\Level \ 4 \to Optical \ Disk\\\\Level \ 5 \to Magnetic\ Tape\\\\\)

Because as memory cost rises below level 5 to level 0. CPU registers become costly as the cache memory, which then, in turn, is much more costly than for the memory.

Whenever the access time of CPU registries becomes reduced from level 5 to level 0, its time complexity between reading/write transactions is much more swift than Cache Memory Access period which in turn is quicker than that of the main memory Communication cost and so forth.

So, we need a memory hierarchy to analyze the information (read/write requests) efficiently, in turn for all the top-level to read the information more quickly and thoroughly. Therefore, the architecture of the computer program's Main memory enables a system to provide secure access to information and guidance for running programs.

Which of the following is a strength of monetary policy?

A. Control of the money supply
B. Time lag
C. Can only be expansionary

Answers

Answer:

A

Explanation:

Monetary has to deal with money.

Other Questions
Nuclear power?The largest non-fossil fuelsource in the worldMay run out in the nextOil?100 yearsSolar power?Uses running waterHydroelectricity?Uses energy directly fromthe sun Need help ASAP!!! I dont know if this is right a zoo has 3 mammals for every 5 retiles if the zoo has 72 mammals how many reptiles does it have A champion weightlifter raises a 240kg barbell a distance of 2.1m. How much potential energy has the barbell gained? The patient has informed the medical assistant that he has a headache. instead of just responding "ok", the medical assistant asks the patient "how long have you been experiencing this headache, and on a scale of 1 -10 how bad is the pain". what type of questioning does this best describe? 1- What was the Boston Tea Party and what did it do ?2- What was the main reason for the Boston tea party ?3- What are 4 facts about the Boston Tea Party4- What was the result of the Boston Tea Party 5- How did the Boston Tea Party start ? True or false The study of landforms is known as biodiversity. what does a break-even point of 100 units mean to a firm? if the viking discovered nova scotia before columbus, why do they say columbus discovered the new world The math team sold 42 hamburger meals and 15 rib meals at the pep rally for a total of $243. At the game that night, they sold 36 hamburger meals and 30 rib meals for a total of $294. What is the cost of 1 rib meal?a. $1 b. $3 c. $4d. $5 In a few words, describe, how the transition to bipedal locomotion changed the hominid skeleton in terms ofthe skullthe spinal columnthe pelvisthe femurthe foot The measure of one interior angle of a reqular 45-gon according to rational expectations theory, what information do businesses and workers use when they form their expectations regarding inflation? Need those answers, please one characteristic of plasmodium and other members of the group it belongs to (such as the causative agents of toxoplasmosis and cryptosporidiosis) is An aircraft encounters a 20 knot crosswind and makes NO heading correction. After 1 hour of flight, how far off course would the aircraft be The autonomic nervous system works to monitor processes such as breathing, heart rate, and digestion. the _____ nervous system is a subsystem within the autonomic system that calms the body. What are the differences between Deza's old school in gary,indiana, and her new school in Flint,Michigan? 5.The temperatures in five cities were 3 F, -5 F, 70 F,-90 F, and -13 F. What was themean temperature of the five cities? (Write your answer as a decimal). 1) The table shows counts from a consumer satisfaction survey of 2,000 customers who called a credit card company to dispute a charge. One thousand customers were male and the remaining were female. Male | Female Satisfied 842 856 Unsatisfied 158 144 (a) What would it mean to find association between these variables? (b) Does the table show association? (You shouldn't need to do any calculation.) (a) Determine what it would mean to find association between the variables for satisfaction and gender. Choose the correct answer below. A. The number of male respondents who were satisfied was the same as the number of female respondents who were satisfied. B. The number of male respondents who were satisfied was the same as the number of female respondents who were unsatisfied.C. Male and female respondents had the same rate of satisfaction in resolving the disputed charge. D. Male and female respondents had different rates of satisfaction in resolving the disputed charge.