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

Mathematical-model with a collection of operations, A mathematical-model wi...

A mathematical-model with a collection of operations described on that model is known as??? Abstract Data Type

Exact analysis of insertion sort, Exact analysis of insertion sort: Let...

Exact analysis of insertion sort: Let us assume the following pseudocode to analyse the exact runtime complexity of insertion sort. T j   is the time taken to execute the s

Binary search technique, Q. Describe the basic concept of binary search tec...

Q. Describe the basic concept of binary search technique? Is it more efficient than the sequential search?         Ans : The bin ary search technique:- This tec

Algorithm that inputs the codes for all items in stock, A shop sells books,...

A shop sells books, magazines and maps. Every item is identified by a unique 4 - digit code. All books have a code which starts with 1, all maps have a code starting with 2 and all

Types of a linked list, A linked list can be of the following types:- ...

A linked list can be of the following types:-  Linear linked list or one way list Doubly linked list or two way list. Circular linked list Header linked list

Process of post-order traversal, Post-order Traversal This can be done ...

Post-order Traversal This can be done both iteratively and recursively. The iterative solution would need a change of the in-order traversal algorithm.

Fifo, give any example of page replacement using fifo and use your own refe...

give any example of page replacement using fifo and use your own reference string

The space - time trade off, The Space - Time Trade Off The best algorit...

The Space - Time Trade Off The best algorithm to solve a given problem is one that needs less space in memory and takes less time to complete its implementation. But in practic

Define the term counting - pseudocode, Define the term counting - Pseudocod...

Define the term counting - Pseudocode Counting in 1s is quite simple; use of statement count = count + 1 would enable counting to be done (for example in controlling a repeat

What is binary search, What is binary search?   Binary search is most ...

What is binary search?   Binary search is most useful when list is sorted. In binary search, element present in middle of the list is determined. If key (the number to search)

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