Starting from:

$20

COEN243-Assignment 1 Solved

1.   Write a program that asks the user to enter three integers and prints the sum, product, and division, and average of these numbers. Here is an example of the execution of the program:

 

*****************************************

Enter the first number: 10

Enter the second number: 5

Enter the second number: 20

 

*****************************************

The results are:

 

          Sum:                                35

          Product:                     1000

          Average:                  11.66

 

*****************************************

2.   Write a program that takes a Celsius temperature from the user and converts it to Fahrenheit and Kelvin. The output should look like this:

 

Celsius Fahrenheit Kelvin 

               4        38.2        277.15 

           

3.   Write a program that takes three integers and outputs them in an ascending order, i.e., for the smallest to the largest number. For example, if the user enters 45, 100, 30, the program should output 30, 45, 100.

 

4.   Write a program that takes the final grade of a student and returns the corresponding letter grade using the following marking scheme:

•  A+ grade =90

•  A 85 <= grade < 90

•  A- 80 <= grade < 85

•  B+ 75 <= grade < 80 • B 70 <= grade < 75

•  C+ 65 <= grade < 70

•  C 60 <= grade < 65

•  C- 55 <= grade < 60

               1/2 COEN 243 – Winter 2021 

 

•  D+ 50 <= grade < 55

•  D 45 <= grade < 50

•  D- 40 <= grade < 45

•  F grade < 40

 

5.   In tax-year 2020, Canada’s income tax brackets are given as below:

•        15% on the first $48,535 of taxable income, plus

•        20.5% on the next $48,534 of taxable income (on the portion of taxable income over $48,535 up to $97,069), plus

•        26% on the next $53,404 of taxable income (on the portion of taxable income over $97,069 up to $150,473), plus

•        29% on the next $63,895 of taxable income (on the portion of taxable income over $150,473 up to $214,368), plus

•        33% of taxable income over $214,368

 

Write a program that takes an income value from the user and calculates the income tax and net income (income – tax) according to the above brackets.  

Test your program with two values of 255000 $ and 132000$ incomes.  

 

More products