Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


Bachelor of Information Technology

ICT113  Programming Fundamentals


Assignment

Write the pseudocode and program structure (using comments) and finally write the program for the following problems with the screenshot of the output.  Each problem is worth 10 marks.

1.    Powerball lottery has 8 numbers in a row. The first 7 numbers are randomly selected between 1   to 35. Once selected that number cannot be selected again. The last number is selected between

1 to 20 inclusive.

You must write a program that will ask the user how many rows they want as input and generates power ball rows as output.

2.   The body mass index (BMI) is calculated as a person’s weight (KG) divided by the square of the person’s height (in m). A BMI in the range 19-25 (inclusive) is considered healthy. Write a program that calculates a person’s BMI and prints a message telling whether they are above, within, or below the healthy range. This program must keep on calculating BMI for the given input till user says, “they don’t want to continue”.

Hint: use a while loop and ask the user if they want to calculate BMI. If the answer is “Yes”, continue with calculations. If the answer is “No” quit the program.

Example:

Input:

Height = 1.78 m

Weight = 102 KG

Process:

BMI = 102 / (1.78*1.78) = 32.2

Output:

Your BMI is 32.19. You are obese. Lose weight to live longer.                     See https://bmicalculatoraustralia.com/ for an example BMI calculator.

3.   A company pays several its employees on an hourly basis. Weekly wages are calculated at $20

per hour for the first 30 hours in the week and then at $30 per hour. Once the total wage is calculated 30% is deducted for taxation purposes.

You must write a program that will read the number of hours worked. Calculate Normal wage, Overtime wage, and the total wage payable to the user. Also calculate the tax payable on total wage.

Wentworth Institute of Higher Education, 302 Elizabeth Street, Sydney   http://www.win.edu.au/ Higher Education CRICOS code: 03279M

The program must print a payslip listing all wages and deductions. Several operators use this       program, so you must write instructions about how to run the program.   In future the company is thinking of storing all the information in text files, so you must write all the logic in functions   so the code can be easily modified.

Screenshot below shows the working of the program;

 

4.   Write a program using TKInter widgets. When run the output window should look like Figure 1  when the Red button is pressed it should look like Figure 2, when the Green button is pressed it should look like Figure 3, and when blue button is pressed looks like Figure 4.