Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Assignment 6.1 CSC 130, Spring 2018 Create Python 3.5 programs, save them in one py file and submit it to Canvas. (a) with the name

Assignment 6.1

CSC 130, Spring 2018

Create Python 3.5 programs, save them in one py file and submit it to Canvas.

(a) with the name Assignment 6.1 appended to your last name

(b) containing print statement to display the name of the assignment i.e. Assignment 6.1

(c) containing print statement to display the name of the programmer (student)

(d) containing print statement to display the date when the assignment was uploaded

(e) for each problem within the assignment include print statement to display the problem number or letter

(f) for each problem within the assignment include print statement to display the problem description

(g) for each problem within the assignment write commands and display the result with the text Result:

Part 1. Create a class Rectangle with simple construction of objects, accessing of rectangle, and possibility of setting the parameters of a rectangle based on the Point Example. Test your code:

a. Create rectangle rectangle1

b. Set parameters of the rectangle so that its down-left corner is in the origin and the up-right corner has position <2,2>

c. Print the values of position of down-left corner and the up-right corner

Part 2. Modify the class Rectangle i.e. include construction of an object with arguments, modify creating string description of the rectangle, computing diagonal of the rectangle, scaling rectangle, shifting rectangle, normalizing rectangle ( setting its down-left corner is in the origin and making diagonal equal to 1) based on the Point example. Test your code:

d. Create rectangle rectangle2 with its down-left corner is in the origin and with the up-right corner in position <2,2>

e. Print the values of position of down-left corner and the up-right corner

f. Print the value of the string describing rectangle2

g. Compute and print diagonal of rectangle2

h. Normalize rectangle2 and print the value of the string describing new rectangle2

i. Create rectangle rectangle3 with its down-left corner in position <1,1> and with the up-right corner in position <3,2>

j. Print the value of the string describing rectangle3

k. Compute and print diagonal of rectangle3

l. Normalize rectangle2 and print the value of the string describing new rectangle3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions