Write an algorithm of value in tax using pseudocode, Data Structure & Algorithms

Assignment Help:

A town contains a total of 5000 houses. Every house owner has to pay tax based on value of the house. Houses over $200 000 pay 2% of their value in tax, houses over $100 000 pay 1.5% of their value in tax and houses over $50 000 pay 1% of their value in tax. All others pay no tax. Write an algorithm to solve this problem using pseudocode.

for count = 1 to5000

input house

if house > 50 000 then tax = house * 0.01

else if house > 100 000 then tax = house * 0.015

else if house > 200 000 then tax = house * 0.02

else tax = 0

print tax

next

 

Notes: (1) a while loop or a repeatloop would have worked just as well

   (2) The use of endif isn't essential in the pseudocode

 For illustration,

count = 0

while count < 5001

input house

if house > 50 000 then tax = house * 0.01

else if house > 100 000 then tax = house * 0.015

else if house > 200 000 then tax = house * 0.02

else tax = 0

endif

endif

endif

print tax

count = count + 1

endwhile

 


Related Discussions:- Write an algorithm of value in tax using pseudocode

Simulation of queues, Simulation of queues: Simulation is the process of f...

Simulation of queues: Simulation is the process of forming an abstract model of a real world situation in order to understand the effect of modifications and the effect of introdu

Explain decision tree, Decision Tree A decision tree is a diagram that ...

Decision Tree A decision tree is a diagram that shows conditions and actions sequentially and therefore shows which condition is to be considered first, second and so on. It is

What is efficiency of algorithm, What is Efficiency of algorithm? Effic...

What is Efficiency of algorithm? Efficiency of an algorithm can be precisely explained and investigated with mathematical rigor.  There are two types of algorithm efficiency

Queues, what is the difference between data type and abstract data type

what is the difference between data type and abstract data type

Values are automatically assigned to those array elements, What values a...

What values are automatically assigned to those array elements which are not explicitly initialized? Garbage values are automatically assigned to those array elements that

Analyze an algorithm, In order to analyze an algorithm is to find out the a...

In order to analyze an algorithm is to find out the amount of resources (like time & storage) that are utilized to execute. Mostly algorithms are designed to work along with inputs

Surrounding of sub division method, Surrounding of sub division method ...

Surrounding of sub division method A polygon surrounds a viewport if it completely encloses or covers the viewport. This happens if none of its sides cuts any edge of the viewp

Algorithm for pre-order traversal, Hear is given a set of input representin...

Hear is given a set of input representing the nodes of a binary tree, write a non recursive algorithm that must be able to give the output in three traversal orders. Write down an

Add the special form let to the metacircular interpreter, (1)  (i) Add the ...

(1)  (i) Add the special form let to the metacircular interpreter Hint: remember let is just syntactic sugar for a lambda expression and so a rewrite to the lambda form is all t

What is a range - a structured type in ruby, Range: A Structured Type in Ru...

Range: A Structured Type in Ruby Ruby has a numerous structured types, comprising arrays, hashes, sets, classes, streams, and ranges. In this section we would only discuss rang

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd