Assessment 1: Individual Assignment (4 marks/question and 20 marks in total)
- The body mass index (BMI) is calculated as a person’s weight (KG) divided by the square of the person’s height (in inches). 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”. Write an algorithm to implement this process and select appropriate structures to produce the program which will execute the process and produce the output.
- Write an algorithm to prompt the user to input a number and check whether the square root of the given number is prime or not. The program should also display the message ‘The number you input is prime’ or ‘The number you input is not prime’.
- Write a program that takes a students’ details (program name, student name, address, DOB and age), and writes to a file (students.txt) using a loop repeatedly. The program terminates on entering any key by the user, except on (Y or y) key. Given this algorithm write a working program
- Write a program that read the file (students.txt) from previous question Q3, and shows all the records/lines from the file as a nicely formatted report with an appropriate header.
- Write a python program to format the following text. Apply string methods to format the text appropriately.
“brief subject description
In this subject, students learn and apply modern software development techniques designed to
streamline and improve the accuracy and reliability of computer programming practice. students use
an interactive development environment (ide) to author, test and execute their computer software
codestudents analyse operational problems using pseudo-code, structure charts. They plan technical
solutions, and create algorithms and data structures to address said problems. The ability to distinguish
and make appropriate use of procedural and event-driven programming paradigms is established.
students learn to initiate, plan, and implement unit testing procedures for their own code and providedCode”
Students must submit their Assignments through Canvas submission link. Email submission will not be accepted.