1: | The currency on planet Blipos is called sopilbs. The aliens on Blipos pay the following amount of tax depending on their income:
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. |
2: | Write a program (using a switch statement) that accepts one of the exam scores A, B, C, D, and E. In response, the program will output the corresponding percentage score, which is A: 90 100; B: 80 89; C: 70 79; D: 60 69; E: 0 59. |
3: | Write a program that can find a number between 0 and 100. The user decides on a number and the program repeatedly makes a guess and constantly narrows in on the number until the number is found. Hint: Let the computer guess on the number in the middle of the possible maximum number and the possible minimum number. For example, the first guess should be 50. If the user indicates the number to be greater, the next guess should be 75, and so on. |