a. A program for laying out a newspaper
b. A program to compute and store bowling score
c. A telephone answering machine
d. A controller for DVD writer
e. A catalog store order entry system
SOLUTION:
a. A program for laying out a newspaper: public class Newspaper
{
Design;
News;
Pictures:
Advertisement;
}
b. A program to compute and store bowling score. public class bowling
{
Startbowl;
Countscore;
Countbowl;
Endbowl;
}
c. A telephone answering machine. public class AnsMchine
{
Call receiving;
Auto Answer;
Msg record;
}
d. A controller for DVD writer. public class Dvdcontrol
{
ReadDVD;
Disk speed;
Write DVD;
}
e. A catalog store order entry system. public class Catalog
{
Product info.;
Stock Management;
Order placing;
Order collection;
Order entry;
}
Q2. There are two lists below. The first is a list of classes that describes implementation objects. The second is a list of operations. For each class, select the operations that make sense for object in class. Discuss the behavior of each operation listed for each class
Classes
variable length array-ordered collection of objects, indexed by integer , whose size can vary at run time
Symbol Table- a table that maps text keywords into description
Set-unordered collection of objects with no duplicates
Operations
Append---add an object to the end of collection
Copy---make a copy of a collection
Count---return the no. of elements in collection
Delete---remove a member from collection
Index---retrieve an object from a collection at a given position
Intersect---determine the common members of two collections
Insert---place an object into a collection at a given position
Update---add a member to a collection, writing over whatever is already there
SOLUTION:
1 Variable length array-ordered collection of objects, indexed by