O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming Exercises

1:The currency on planet Blipos is called sopilbs. The aliens on Blipos pay the following amount of tax depending on their income:
  • 0% of income less than or equal to 10000 sopilbs

  • 5% of income that is greater than 10000 and less than or equal to 25000 sopilbs

  • 10% of income that is greater than 25000 and less than or equal to 50000 sopilbs

  • 15% of income that is greater than 50000 and less than or equal to 100000 sopilbs

  • 20% of income that is greater than 100000 sopilbs

So if an alien earns 60000 sopilbs, it will have to pay the following amount in tax: 0 * 10000 + 0.05 * 15000 + 0.1 * 25000 + 0.15 * 10000 = 4750.

Write a program that accepts a certain income as input and from that amount calculates and outputs the tax payable. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required