Questions
Write a program, called NationalTax, that will simulate calculating a citizen's income tax for the year....

Write a program, called NationalTax, that will simulate calculating a citizen's income tax for the year.

A country uses lettered ID's to identify its citizens. Valid ID's will be either 8 or 9 characters long. All characters entered will be alphabetic characters only (a-z or A-Z).

  • Display a welcome message.
  • Prompt the user for their ID and read it in.
  • Next, determine if the ID is valid based on its length.
    • If it is not valid, simply state that the ID is invalid and let the program end naturally (you may NOT use System.exit).
    • However, if it is valid, then do the following:
      • Prompt the user for the tax year (entered as a four-digit integer). No validity check needs to happen here.
      • Prompt the user for their annual income (this includes dollars and cents) and read it in. Since no annual income can be less than zero, if the user enters a negative amount, simply convert it to its positive amount. You may not use if/else statements here. Use the appropriate Math library method.
      • Convert the ID to all CAPS.
      • Display the ID.
      • Display the annual income as dollars and cents.
      • Set the tax amount to be log10 of their annual income multiplied by 100. Display this as their initial tax amount.
      • Then if the first character of the ID is in the range:
        • A - G, then the person works for the government. Reduce their tax by 10%. Display that they are a government employee, that they receive a 10% tax reduction, and display the new tax amount.
        • H - P, then the person works in the public sector. There is no tax reduction. Display they they are a public sector employee and that they receive no tax reduction.
        • Q - U, then the person is unemployed. Display that they are unemployed and that they receive no tax reduction.
        • Otherwise the person is retired. Reduce their tax by 25%. Display that they are retired, that they receive a 25% tax reduction, and display the new tax amount.
      • Then if the last character of the ID is greater than the first character:
        • the person is 21 years old or older. They pay an additional $100 in taxes. Add this to their current tax amount. Display that they are 21 years of age or older, that there is an additional $100 tax, and display the new tax amount.
        • Otherwise the person is less than 21 years old. There is no additional tax. Display that the are under 21 years of age and do not pay the additional tax.
      • Then if the ASCII value of the fifth letter (remember indexing starts at 0) of the ID (as a capital letter) is divisible by 7
        • that person is a millionaire. Their tax is the larger of the current tax amount and $15,000. Display that they are a millionaire, that their tax is the larger of their current tax amount (display the value) and $15,000, and display their new tax amount.
        • Otherwise they are not. Display nothing.
      • Then if the ID contains the string "MED" (remember case does not matter in the ID):
        • then they are a medical professional. Their tax is reduced by $100. Display that they are a medical profession, they their tax is reduced by 100, and display the new tax amount.  
        • Otherwise they are not. Display nothing.
      • Then if the final tax amount is negative, change it to 0.
      • Finally, in one printf statement, display a message that tells the user the ID, the tax year, their annual income, and their final tax amount owed.

In: Computer Science

(Extra Credit) What is the value of the following cash flows in year 6? What is...

(Extra Credit) What is the value of the following cash flows in year 6? What is the value today? Assume interest rates today are 6.5%, then rates will be 6.25% for the next 4 years, 3.75% for the next 3 years, 5.3% for the next 4 years, and 3.75% thereafter.

Year Cash Flow

6 $5,675

8 $9,725

10 $6,750

17 $11,750

In: Finance

Write the Flowchart for the following programming problem based on the pseudocode below. Last year, a...

Write the Flowchart for the following programming problem based on the pseudocode below.

Last year, a local college implemented rooftop gardens as a way to promote energy efficiency and save money. Write a program that will allow the user to enter the energy bills from January to December for the year prior to going green. Next, allow the user to enter the energy bills from January to December of the past year after going green. The program should calculate the energy difference from the two years and display the two years’ worth of data, along with the savings.

Hints: Create three arrays of size 12 each. The first array will store the first year of energy costs, the second array will store the second year after going green, and the third array will store the difference. Also, create a string array that stores the month names. These variables might be defined as follows:

notGreenCost = [0] * 12

goneGreenCost = [0] * 12

savings = [0] * 12

months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']

   

Your sample output might look as follows:

Enter NOT GREEN energy costs for January

Enter now -->789

Enter NOT GREEN energy costs for February

Enter now -->790

Enter NOT GREEN energy costs for March

Enter now -->890

Enter NOT GREEN energy costs for April

Enter now -->773

Enter NOT GREEN energy costs for May

Enter now -->723

Enter NOT GREEN energy costs for June

Enter now -->759

Enter NOT GREEN energy costs for July

Enter now -->690

Enter NOT GREEN energy costs for August

Enter now -->681

Enter NOT GREEN energy costs for September

Enter now -->782

Enter NOT GREEN energy costs for October

Enter now -->791

Enter NOT GREEN energy costs for November

Enter now -->898

Enter NOT GREEN energy costs for December

Enter now -->923

-------------------------------------------------

Enter GONE GREEN energy costs for January

Enter now -->546

Enter GONE GREEN energy costs for February

Enter now -->536

Enter GONE GREEN energy costs for March

Enter now -->519

Enter GONE GREEN energy costs for April

Enter now -->493

Enter GONE GREEN energy costs for May

Enter now -->472

Enter GONE GREEN energy costs for June

Enter now -->432

Enter GONE GREEN energy costs for July

Enter now -->347

Enter GONE GREEN energy costs for August

Enter now -->318

Enter GONE GREEN energy costs for September

Enter now -->453

Enter GONE GREEN energy costs for October

Enter now -->489

Enter GONE GREEN energy costs for November

Enter now -->439

Enter GONE GREEN energy costs for December

Enter now -->516

-------------------------------------------------

                        SAVINGS                     

_____________________________________________________

SAVINGS     NOT GREEN     GONE GREEN         MONTH

_____________________________________________________

$ 243          $ 789          $ 546           January

$ 254          $ 790          $ 536           February

$ 371          $ 890          $ 519           March

$ 280          $ 773          $ 493           April

$ 251          $ 723          $ 472           May

$ 327          $ 759          $ 432           June

$ 343          $ 690          $ 347           July

$ 363          $ 681          $ 318           August

$ 329          $ 782          $ 453           September

$ 302         $ 791          $ 489           October

$ 459          $ 898          $ 439           November

$ 407          $ 923          $ 516           December

Do you want to end program? (Enter no or yes): yes

The Pseudocode

Module main()

            //Declare local variables

            Declare endProgram = “no”

            While endProgram == “no”

                        Declare Real notGreenCost[12]

                        Declare Real goneGreenCost[12]

                        Declare Real savings[12]

Declare String months[12] = “January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”

                          //function calls

                        getNotGreen(notGreenCost, months)

                        getGoneGreen(goneGreenCost, months)

                        energySaved(notGreenCost, goneGreenCosts, savings)

                        displayInfo(notGreenCost, goneGreenCosts, savings, months)

           

                        Display “Do you want to end the program? Yes or no”

                        Input endProgram

            End While

End Module

Module getNotGreen(Real notGreenCost[], String months[])

            Set counter = 0

            While counter < 12

                        Display “Enter NOT GREEN energy costs for”, months[counter]

                        Input notGreenCosts[counter]

                        Set counter = counter + 1

            End While       

End Module

Module getGoneGreen(Real goneGreenCost[], String months[])

            Set counter = 0

            While counter < 12

                        Display “Enter GONE GREEN energy costs for”, months[counter]

                        Input goneGreenCosts[counter]

                        Set counter = counter + 1

            End While       

End Module

Module energySaved(Real notGreenCost[], Real goneGreenCost[], Real savings[])

            Set counter = 0

            While counter < 12

                        Set savings[counter] = notGreenCost[counter] – goneGreenCost[counter]

                        Set counter = counter + 1

            End While

End Module

Module displayInfo(Real notGreenCost[], Real goneGreenCost[], Real savings[], String months[])

            Set counter = 0

            While counter < 12

                        Display “Information for”, months[counter]

                        Display “Savings $”, savings[counter]

                        Display “Not Green Costs $”, notGreenCost[counter]

                        Display “Gone Green Costs $”, goneGreenCost[counter]

            End While

End Module

In: Computer Science

An office building is expected to create operating cash flows of $26,500 a year for three...

An office building is expected to create operating cash flows of $26,500 a year for three years, based on tenants' rental income. The purchase of the fixed assets for this building will cost $55,000. These assets will have no value at the end of the project. An additional $5,000 of net working capital will be required throughout the life of the project. Calculate the net present value of this project if the required rate of return is 15 percent?

Multiple Choice

  • $8,793.05

  • $3,793.05

  • $1,566.67

  • $505.47

  • $-1,206.95

In: Finance

The Boring Corporation is considering a 3-year project with an initial cost of $1,020,000. The project...

The Boring Corporation is considering a 3-year project with an initial cost of $1,020,000. The project will not directly produce any sales but will reduce operating costs by $640,000 a year. The equipment is depreciated straight-line to a zero book value over the life of the project. At the end of the project the equipment will be sold for an estimated $156,000. The tax rate is 34 percent. The project will require $28,000 in extra inventory for spare parts and accessories. Should this project be implemented if The Boring Corporation requires a rate of return of 16 percent? Why or why not?

Multiple Choice

  • yes; The NPV is $314,960.00

  • yes; The NPV is $370,509.74

  • no; The NPV is $272,189.10

  • yes; The NPV is $244,189.10

  • yes; The NPV is $97,042.85

Next Visit question map

Question8of10Total8 of 10

Prev

In: Finance

in Java Write a function that inputs a 4 digit year and outputs the ROMAN numeral...

in Java

Write a function that inputs a 4 digit year and outputs the ROMAN numeral year
M is 1,000
C is 100
L is 50
X is 10
I is 1
Test with 2016 and 1989

In: Computer Science

Swanton Industries is expected to pay a dividend of $5 per year for 10 years and...

Swanton Industries is expected to pay a dividend of $5 per year for 10 years and then increase the dividend to $10 per share for every year thereafter. The required rate of return on this stock is 20 percent. What is the estimated stock price for Swanton?

In: Finance

You are buying a house and will borrow $225,000 on a 30-year fixed rate mortgage with...

You are buying a house and will borrow $225,000 on a 30-year fixed rate mortgage with monthly payments to finance the purchase. Your loan officer has offered you a mortgage with an APR of 4.3 percent. Alternatively, she tells you that you can “buy down” the interest rate to 4.05 percent if you pay points up front on the loan. A point on a loan is 1 percent (one percentage point) of the loan value. How many points, at most, would you be willing to pay to buy down the interest rate?

In: Finance

The real risk-free rate is 3.00%. Inflation is expected to be 2.50% this year and 4.00%...

The real risk-free rate is 3.00%. Inflation is expected to be 2.50% this year and 4.00% during the next 2 years. Assume that the maturity risk premium is zero.

What is the yield on 2-year Treasury securities? Do not round intermediate calculations. Round your answer to two decimal places.

  %

What is the yield on 3-year Treasury securities? Do not round intermediate calculations. Round your answer to two decimal places.

  %

In: Finance

An investor is considering purchasing a Treasury bond with a 20 year maturity, an 8% coupon...

An investor is considering purchasing a Treasury bond with a 20 year maturity, an 8% coupon and a 9% required rate of return. The bond pays interest semiannually.

a)What is the bond's modified duration?

b)If promised yields rise 25 basis points immediately after the purchase what is the predicted price change in dollars based on the bond's duration?

(please solve with formula not the macauly duration chart)

In: Finance