Question: Git Repository and Development Environment You are required to: 1 . Create a new Git repository on sc - gitlab.ufv.ca named 2 0 2 4
Git Repository and Development Environment You are required to: Create a new Git repository on scgitlab.ufv.ca named compon assignment NB: corrected assignment to assignment above Develop your code on ufv.syzygyca Use SSH authentication for interacting with your Git repository. Add the user janzenc as a developer to your repository. Commit your work frequently with meaningful commit messages. Submit your Git repository URL on Blackboard once completed. Problem Overview You will create two classes: A Rectangle class to model a rectangle with methods to calculate its area and perimeter. A Circle class to model a circle with methods to calculate its area and circumference. You will then instantiate both classes, set their properties, and display the calculated results. Instructions Part : Define the Rectangle Class marks Define a class named Rectangle. The class should have two private attributes: width and height both default to Include the following methods: init self width: float, height: float Constructor to Part : Part : initialize the width and height. get widthself float Returns the width. get heightself float Returns the height. set widthself width: float Sets a new width should vali date that the width is positive set heightself height: float Sets a new height should validate that the height is positive calculate areaself float Returns the area of the rectan gle width times height calculate perimeterself float Returns the perimeter of the rectangle times width height Define the Circle Class marks Define a class named Circle. The class should have one private attribute: radius default to Include the following methods: init self radius: float Constructor to initialize the ra dius. get radiusself float Returns the radius. set radiusself radius: float Sets a new radius should validate that the radius is positive calculate areaself float Returns the area of the circle pi times radius calculate circumferenceself float Returns the circum ference of the circle times pi times radius Instantiating and Testing the Classes marks Create an instance of the Rectangle class and set the width to and the height to Create an instance of the Circle class and set the radius to Print the following details: The width, height, area, and perimeter of the rectangle. The radius, area, and circumference of the circle. Part : Handling Invalid Input mark Modify the set width, set height, and set radius methods to raise a ValueError if a negative or zero value is passed. Expected Output Your program should produce output similar to the following: Rectangle width: Rectangle height: Area: Perimeter: Circle radius: Area: Circumference: Submitting the Assignment Push your final code to your Git repository on scgitlab.ufv.ca Ensure that the user janzenc has been added as a developer on your repository. Submit the repository URL in the Blackboard drop box. Criteria Part marks: Class definition, methods, and validation for the Rectangle class. Part marks: Class definition, methods, and validation for the Circle class. Part marks: Instantiation and printing of the results for both classes. Part mark: Handling of invalid input using exception
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
