Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q1 As a freelance programmer, you received a job to create a computer program that automate the computation process of the centroid location of selected
Q1 As a freelance programmer, you received a job to create a computer program that automate the computation process of the centroid location of selected shape. The shape of interest for this program are a) Rectangular; b) Triangle; and c) Semicircle. List of the program requirement are as follows: Requirement 1 The program allow user to select their shape of interest from either Rectangular, Triangle or Semicircle. Requirement 2 The program must allow user to enter: The coordinate of the origin for x and y axis. All necessary dimensions (length, height, radius and etc.) of the selected shape. . Example of how object (Rectangular) is place on the x-y plane is shown in the following figure. Centroid (x,y) Origin (0,0) Requirement 3 Make sure that the program able to validate the input value as following: The program only allow user to select either Rectangular, Triangle or Semicircle. Other than these shapes are not valid. If the user enters invalid input, the program should be able to notify user that the input value is invalid and redirect the user to enter the right input. Apply appropriate control structure. Requirement 4 If all inputs from the user is correct, then the program will compute the location of the centroid for selected shape. The location must be presented in x and y axis. Requirement 5 If the program is successfully executed, the final output should be displayed as following format example. Shape Selection: Rectangular Origin Coordinate: (0,0) Centroid Location: (8,7) (a) Design the algorithm of the proposed program by using: (i) Pseudocode (7 marks) (ii) Flowchart (8 marks) Write or draw your answer in a piece of paper and save it in PDF file for the submission. Save and submit your PDF file as the following format: FullName_MatricNumber_01 (a).pdf (b) Write a complete Python program in Jupyter Notebook file (.ipynb file) based on the guided algorithm that have been constructed in Q1(a). Save and submit your Jupyter Notebook file according to the following format: FullName_MatricNumber_01 (b).ipynb (15 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started