Purchase Solution

How to Generate Input Test Values to Check Program

Not what you're looking for?

Ask Custom Question

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

Purchase this Solution

Solution Summary

Shows using an example pseudo code applicable to any high level language

Solution Preview

From my understanding of your statement, you need to test your code/algorithm with a set of ...

Purchase this Solution


Free BrainMass Quizzes
Basic Networking Questions

This quiz consists of some basic networking questions.

Javscript Basics

Quiz on basics of javascript programming language.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.