Computer-aided software engineering tool

Assignment Help Python Programming
Reference no: EM133087586

Lab - Objects, Class Diagrams and UML

Introduction

We had a brief look at Objects in week 6 - this week we revisit objects together with a look at a Computer-aided software engineering (CASE) tool - Enterprise Architect (EA).

Consider the following Python code that we looked at in week 6:

class Student():
def init (self, first_name, last_name, student_id): self.first_name = first_name
self.last_name = last_name self.student_id = student_id
def display(self):
print("{0}, {1} ({2})").format(last_name, first_name,
student_id))
We could draw a class diagram by hand - which is fine - if it is only a small class or two; if the code involves many more classes some help is greatly appreciated. Let us take a quick look at EA; on Startup, The screen should look something like this:

Cancel the Startup Dialog and close the Start Page. From the Menu choose File -> New Project and create a new project called Week10.

Use the code in week 6 for the Car and ElectricCar (the first version is fine). It should look something like this. (In this case a main class has also been and imported together with Car.py and ElectricCar.py)

Note that ElectricCar has inherited from Car. You can click on the instantiation of an electric car and view its attributes.

Enterprise Architect is an industrial strength CASE tool which lets us do many things.

Just one more thing. Consider the following code:

"""
File: Student.py
Resources to manage a student's name and test scores. """
class Student(object): """Represents a student."""
def init (self, name, number):
"""Constructor creates a Student with the given name and number of scores and sets all scores to 0."""
self.name = name self.scores = []
for count in range(number): self.scores.append(0)

def getName(self):
"""Returns the student's name.""" return self.name

def setScore(self, i, score):
"""Resets the ith score, counting from 1.""" self.scores[i - 1] = score

def getScore(self, i):
"""Returns the ith score, counting from 1.""" return self.scores[i - 1]
def getAverage(self):
"""Returns the average score."""
return sum(self.scores) / len(self.scores) def getHighScore(self):
"""Returns the highest score.""" return max(self.scores)
def str (self):
"""Returns the string representation of the

student."""
return "Name: " + self.name + "\nScores: " + \ " ".join(map(str, self.scores))

Notice the triple docs (""" """) at 3 different levels. The first level is that of the module.
The second level is just after the class header. There might be more than one class defined in a module, so each class can have a docstring to describe its purpose.
The third level is located after each method header.

Attachment:- Class Diagrams and UML.rar

Reference no: EM133087586

Questions Cloud

Perception of victim by different constituents : Discuss whether factors of class, race, and sexual orientation affect the perception of the victim by different constituents, including the public,
Juvenile delinquency : Should we as a society blame a child who grows up in such an environment for criminal acts?
About differences between races-marriage and education : Think about a former belief you might have had about differences between races, marriage, and/or education.
Information regarding hate crime laws : You will read a specific hate crime example and information regarding hate crime laws
Computer-aided software engineering tool : Draw a class diagram by hand - which is fine - if it is only a small class or two; if the code involves many more classes some help is greatly appreciated
Write a reflection on how you managed your time : Write a reflection on how you managed your time, utilising the timetable and using Pomodoro or Eisenhower to manage your study. Use Gibb's model to structure yo
Contrast the four ways managers make decisions : Compare and contrast the four ways managers make decisions.
Gibb model to structure reflection : Write a reflection on how you managed your time, utilising the timetable and using Pomodoro or Eisenhower to manage your study. Use Gibb's model to structure yo
Course sustainable business management : How would you describe the strategy of the company?

Reviews

Write a Review

Python Programming Questions & Answers

  Define interpreted vs compiled languages

Define Interpreted vs Compiled Languages and Interpretive Overhead vs Object Orientation vs Logic Programing Paradigms.

  Implementing an audio fingerprinting system

Implementing an audio fingerprinting system for reverse search database search, similar to the Shazam service, that is capable of identifying songs from short

  Implement solution algorithm using basic programming

Develop self-reliance and judgement in adapting algorithms to diverse contexts - Design and write program solutions to identified problems using accepted

  Write a program to analyze a car loan

Write a program to analyze a car loan. The user should enter the amount of the loan, the annual percentage rate of interest and the duration.

  Write a python program that generates an informative website

ICT112 - University of Sunshine Coast - Generated Web Site for Aussie Road Fatalities - write a Python program that generates an informative web site

  Write a python script that builds an html file

Write a Python script that builds an HTML file of your own design. Add an image tag into your HTML and link it to an image on your hard drive.

  What is the average size of each color diamond

Using pandas and the diamonds data set from class - What is the average size of each color diamond. Plot the density of the prices

  Create a program that will read in prices from the user

Create a program that will read in prices from the user and add them to a list. Ask the user in between each price if they want to continue (y/n).

  Create two instance variables to store the speed

Create two instance variables to store the speed and the height of the drone. Initialize them to 0.0. This method has no parameters other than self.

  KF7006 Machine Learning Assignment

KF7006 Machine Learning Assignment Help and Solution, Northumbria University - Assessment Writing Service - Demonstrate knowledge and understanding of the core

  Interaction between the customer and the machine

In Python:Simulate a cash register or ATM including the interaction between the customer and the machine (i.e. assume that you are automating the responses)

  Relationship between the features and the output variable

AIT91001 - Computational Intelligence and Machine Learning - apply the machine learning process to model the relationship between features and output variable

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd