Please show all work and answer all parts using python, thanks!



Shape2D.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 20 10:14:24 2020
@author: vibhav
"""
class Shape2D:
color = ""
def __init__(self, color):
self.color = color
def getColor(self):
return self.color
def getShapeProperties(self):
return 'Shape: N/A, ' +
'Color: ' + self.color
Circle.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 20 10:23:15 2020
@author: vibhav
"""
import math
from Shape2D import Shape2D
class Circle(Shape2D):
def __init__(self, color, radius):
super().__init__(color)
self.radius =
radius
def getRadius(self):
return self.radius
def setRadius(self, radius):
self.radius =
radius
def computeArea(self):
return math.pi
*self.radius*self.radius
def computePerimeter(self):
return
2*math.pi*self.radius
def getShapeProperties(self):
return_str = 'Shape:
CIRCLE, '
return_str += 'Color: '
+ self.color
return_str += ', Radius:
' + str(self.radius)
return_str += ', Area: '
+ str(self.computeArea())
return_str += ',
Perimeter: ' + str(self.computePerimeter())
return return_str
Square.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 20 10:40:47 2020
@author: vibhav
"""
from Shape2D import Shape2D
class Square(Shape2D):
def __init__(self, color, side):
super().__init__(color)
self.side = side
def getSide(self):
return self.side
def setSide(self, side):
self.side = side
def computeArea(self):
return
self.side*self.side
def computePerimeter(self):
return 4*self.side
def getShapeProperties(self):
return_str = 'Shape:
SQUARE, '
return_str += 'Color: '
+ self.color
return_str += ', Side: '
+ str(self.side)
return_str += ', Area: '
+ str(self.computeArea())
return_str += ',
Perimeter: ' + str(self.computePerimeter())
return return_str
test.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 20 10:17:12 2020
@author: vibhav
"""
from Shape2D import Shape2D
from Circle import Circle
from Square import Square
s1 = Shape2D('blue')
print(s1.getShapeProperties(),end="")
print()
c1 = Circle("blue", 2.5)
print(c1.getShapeProperties(),end="")
print()
s2 = Square('blue', 2.5)
print(s2.getShapeProperties(),end="")




![In [10]: runfile( /home/vibhav/testFile.py, wdir=/home/vibhav) Reloaded modules: Shape2D, Circle, Square Shape: N/A, Colo](http://img.homeworklib.com/questions/1151e850-be65-11eb-89ff-1f87b818c378.png?x-oss-process=image/resize,w_560)
Please show all work and answer all parts using python, thanks! Instructions You will need to...
Python only please, thanks in advance.
Type up the GeometricObject class (code given on the back of the paper). Name this file GeometricObjectClass and store it in the folder you made (xxlab14) 1. Design a class named Rectangle as a subclass of the GeometricObject class. Name the file RectangleClass and place it in the folder. 2. The Rectangle class contains Two float data fields named length and width A constructor that creates a rectangle with the specified fields with default...
Language is JAVA.
Clarification for the Shape class (highlighted):
The following requirements specify what fields you are expected
to implement in your Shape class;
- A private String color that specifies the color of the
shape
- A private boolean filled that specifies whether the shape is
filled
- A private date (java.util.date) field dateCreated that
specifies the date the shape was created Your Shape class will
provide the following constructors;
- A two-arg constructor that creates a shape
with...
IN JAVA For the following questions, “define a class” means the following: • Create an appropriately-named file containing the Java class definition, including the following: – A block comment describing the file (and hence the class), as always – Any instance variables, as required by the question – Accessor (getter) and mutator (setter) methods for any instance variables – Constructors as appropriate or as required by the question – A toString method that prints instances of the class informatively –...
Python only please, thanks in advance.
Type up the GeometricObject class (code given on the back of the paper). Name this file GeometricObjectClass and store it in the folder you made (xxlab14) 1. Design a class named Rectangle as a subclass of the GeometricObject class. Name the file RectangleClass and place it in the folder. 2. The Rectangle class contains Two float data fields named length and width A constructor that creates a rectangle with the specified fields with default...
11p
Python Language
Read the following code for oofraction. import oofraction class OOFraction: def main(): fl = oofraction.o0Fraction( 2, 5) f2 = oofraction.o0Fraction ( 1, 3) f3 = f1 + f2 print (str(3)) main() def __init__(self, Num, Den): self.mNum = Num self.mDen = Den return def_add_(self,other): num = self.mNumother.mDen + other.mNum*self.mDen den = self.mDen*other.mDen f = OOFraction(num,den) return f 1. Write the output below. def_str_(self): s = str( self.mNum )+"/" + str( self.mDen) returns 2. Write a class called wholeNum...
You will be creating a driver class and 5 class files for this assignment. The classes are Shape2D (the parent class), Circle, Triangle, and Rectangle (all children of Shape2D) and Square (child of Rectangle). Be sure to include a message to the user explaining the purpose of the program before any other printing to the screen. Within the driver class, please complete the following tasks: Instantiate a Circle object with 1 side and a radius of 4; print it Update...
Use Python 3 Create a program that uses Turtle to draw shapes. Show the following menu: Enter Circle Enter Rectangle Remove Shape Draw Shapes Exit Circles – User inputs position, radius, and color. The position is the CENTER of the circle Rectangles – User inputs position, height, width, color. The position is the lower left-hand corner Colors – Allow red, yellow, blue, and green only Remove – Show the number of items in the list and let the user enter...
Written in python using puTTy!!
i'm having a lot of trouble with this, will upvote!
also here is the address.csv file
Name,Phone,Email,Year_of_Birth
Elizi Moe,5208534566,emoe@ncsu.edu,1978
Ma Ta,4345667345,mta@yahoo.com,1988
Diana Cheng,5203456789,dcheng@asu.edu,1970
ACTIVITY I
Implement in Python the Subscriber class modeled by the UML
diagram provided below. Save in a file called MyClasses.py
Subscriber
name: string
yearOfBirth: int
phone: string
email: string
getName()
getAge()
getPhone()
getEmail()
Write a test program that does the following:
Read the file addresses.csv.
For each record, create an object...
This question is about java program. Please show the output and the detail code and comment.And the output (the test mthod )must be all the true! Thank you! And the question is contain 7 parts: Question 1 Create a Shape class with the following UML specification: (All the UML "-" means private and "+" means public) +------------------------------------+ | Shape | +------------------------------------+ | - x: double | | - y: double | +------------------------------------+ | + Shape(double x, double y) | |...
IN PYTHON Assignment Overview This assignment will give you experience on the use of classes. Understand the Application The assignment is to first create a class calledTripleString.TripleStringwill consist of threeinstance attribute strings as its basic data. It will also contain a few instance methods to support that data. Once defined, we will use it to instantiate TripleString objects that can be used in our main program. TripleString will contain three member strings as its main data: string1, string2, and string3....