Object-Oriented Development
For an acceptable P1 submission:
Part I: Class Design (numGen.cs)
Design an encapsulated numGen class. Each numGen object encapsulates two different ‘gen’ numbers. If active, an object returns a valid number. If not active, zero is returned. For example, with active numGen myObj that encapsulates 4 and 7 as its ‘gen’ numbers, successive client results are:
myObj.value(); // returns 4
myObj.value(); // returns 7
myObj.value(); // returns -4
myObj.value(); // returns -7 and is the end of cycle#1
myObj.value(); // returns 4 is the beginning of cycle#2
Every numGen object is initially active but transitions to inactive once the number of cycles equals the sum of the ‘gen’ numbers – in above example, 11 (4 + 7 = 11) values would be returned before the object becomes inactive. The client may reset and revive a numGen object in addition to requesting values. An attempt to revive an active numGen object causes that object to be permanently deactivated.
Many details are missing. You MUST make and DOCUMENT your design decisions!!
This assignment is an abstract realization of a data sink (store) that yields specific information upon query but can age and become invalid. With the interface described above, your design should encapsulate and control state as well as the release of information. Do NOT tie your type definition to the Console.
Use Unit Testing to verify your class functionality.
Part II: Driver (P1.cs) -- External Perspective of Client – tests your class design
Design a FUNCTIONALLY DECOMPOSED driver to demonstrate the program requirements.
Use many distinct objects, initialized appropriately, i.e. random distribution of numGens, etc.
Adequate testing requires varied (random) input sufficient enough to yield objects in different states and the seamless alteration of the state of some objects.
Make your output readable but not exceedingly lengthy.
.
.
Sample Grading: Class Design (75 points)
Form (25 points)
Contractual Design
Interface and Implementation invariants
Pre & Post conditions
Proper Accessibility (public, private)
Appropriate functionality present in interface
Readable code (no hardcoding)
Functionality ( 50 points )
Data Type implemented as required
clear, effective interface
minimal getSize() or the like
no dependencies on implementation exposed, etc.
Data members defined & manipulated as required
Effective representation of state
Constructor(s)
put object in proper initial state
State transitions correct
Unit Testing
Sample Grading: Driver (25 points)
Form (10 points)
Program overview
PROGRAMMER name, date, revision history, platform, etc.
Description of process(es) performed by program
Explanation of user interface (input, meaning of output)
Comments on use and validity (error processing)
Statement of assumptions
Maintainable code (no hardcoding)
Functionality ( 15 points ): Correlate to Documented Design Decisions
Requirements fulfilled – type tested appropriately
No unnecessary dependencies
User Interface (clear, correct & effective)
Output (readable & consistent with design)
Random number generator used appropriately
File(s) manipulated appropriately
existence not assumed
read only once
closed after use
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of