Você está na página 1de 2

CIS 1400: Programming and Logic Technique

Lab Assignment

Name:

Lab Assignment #10 Object Oriented Programming


Due Date 04/29/2014
(beginning of class)
Points Multiple Choice __________/ 16 pts.
Programming Exercise (Song class)
UML Diagram __________/ 14 pts.
Class Pseudocode __________/ 12 pts.
Python Class __________/ 10 pts.
Python Program __________/ 8 pts.
Program Run __________/ 2 pts.
Output Data File __________/ 3 pts.
Total __________/ 65 pts.

Lab Assignment #10 Activities


1. Answer the following Chapter 14 Multiple Choice Review Questions on
pages 559 to 561 of your textbook. (16 points)

Question Number Your Answer


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

College of DuPage 1 CREngland


CIS 1400: Programming and Logic Technique
Lab Assignment

2. Design a program to keep track of your music inventory.


a) Use appropriate data types when using a software application to
create the UML diagram for a Song class that contains the
following private fields:
artist name of singer or group
title song name
time song time (in seconds or minutesnumerical value)
year release year
In addition, the class should have the following public constructor
and other methods:
Constructor takes parameter values for artist, title, time and
year as arguments and sets the appropriate class fields.
Accessor and mutator methods for each field.
Be sure to include data types, parameters, and access
specification notation on the UML Diagram (see Figures 14-13 on
page 536 in your textbook for example). Remember to label the
UML diagram with your name, date, class, and lab assignment
number and attach to this lab assignment. (14 points)
b) Use a software application to create the pseudocode format
given in the textbook for the class definition. Be sure to include the
fields, constructors, and other methods for full credit. Remember
to label the pseudocode with your name, date, class, and lab
assignment number and attach to this lab assignment. (12 points)
c) Create a modular (no global variables or constants) program using
Python that prompts the user for field details to create two
separate song objects (not an array) using the previous constructor
from the class design requirements. Calculate the total running
time for both song objects, using the accessor methods, and
display to the screen. Write the data for each of the song objects
to a text file called song_inventory.dat. Attach hardcopies of the
following:
Python code for class with header comments that include
name, date, class, and short description of file contents. (10
points)
Python code for program with header comments that include
name, date, class, and short description of file contents. End of
program comments should include a sample program run. (8
points code and header, 2 points sample program run)
File song_inventory.dat from sample program run. (3 points)

College of DuPage 2 CREngland

Você também pode gostar