logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

C# and Visual Studio upload all files (NOT a project) to Canvas use Unit Testing to verify the functionality of class numGen

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Object-Oriented Development

 

For an acceptable P1 submission:

  1. use C# and Visual Studio
  2. upload all files (NOT a project) to Canvas
  3. use Unit Testing to verify the functionality of class numGen
  4. use Programming by Contract to specify contractual design, placing
    1. class and interface invariants at the top of cs file
    2. implementation invariant at the end of cs file
    3. pre & postonditions (if they exist) before each method header
  5. write readable code – see codingStd.docx in the PA folder under Files on Canvas
  6. employ the OOP tenets of abstraction, encapsulation and information hiding
  7. use functional decomposition => NO monolithic drivers
  8. document your driver:
    1. ProgrammingByContract NOT used for drivers
    2. DO NOT assume that the reader has access to this assignment specification
    3. provide an overview of your program
    4. explicitly state ALL assumptions
  9. do NOT hard code: replace arbitrary literals, such as ’42, with constants

 

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

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

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. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

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

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

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

. 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 Sea Ports. Here are the classes and their instance variables we wish to define:

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

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

872 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

706 Answers

Hire Me
expert
Husnain SaeedComputer science

553 Answers

Hire Me
expert
Atharva PatilComputer science

529 Answers

Hire Me