Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

I am asked to generate a set of INPUT TEST VALUES. Is that included into this control structure, or do I have to create a whole different set of variables?

(if you have to create an extended set of variables please return posting so I can add more credits.)

Declared Variables

Input: salary in real
Output: tax in real
Other: baseTax in real, minimum in real, Excess in real

Control Structure: if-then-else (dual alternative)

Method Taxation:
Begin
If salary is negative exit with error

If salary <= 1499.99 then
Minimum = 0
baseTax = 0
Excess = 0.15
tax = calculateTax(minimum, baseTax, Excess, salary)

Else If salary <= 2999.99 then
Minimum = 1500
baseTax = 225
Excess = 0.16
tax = calculateTax(minimum, baseTax, Excess, salary)

Else If salary <= 4999.99 then
Minimum = 3000
baseTax = 465
Excess = 0.18
tax = calculateTax(minimum, baseTax, Excess, salary)

Else If salary <= 7999.99 then
Minimum = 5000
baseTax = 825
Excess = 0.20
tax = calculateTax(minimum, baseTax, Excess, salary)

Else If salary <= 14999.99 then
Minimum = 8000
baseTax = 1425
Excess = 0.25
tax = calculateTax(minimum, baseTax, Excess, salary)

showTax()

End Taxation

Subroutine calculateTax:
calculateTax(baseTax, salary)
Begin
Tax = baseTax + (salary - minimum) * Excess
Return Tax
End calculateTax

Subroutine showTax:
showTax()
Begin
Print "The Tax amount is ", tax
End

Java, Programming

  • Category:- Java
  • Reference No.:- M91616434
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Java

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As