Provide a class diagram for every user authored class

Assignment Help C/C++ Programming
Reference no: EM13317731

Task 1 Designing and Documenting your system

Examine the sample code you have been provided with. This code is for a simple Car Hire management system. It contains a number of classes. Class Diagrams for Car and Person classes are provided here for illustration purposes ( Note that get and set methods are not shown in the class diagrams, in keeping with convention, although they do exist.)

Car class               Person class

Car

String make

String model

String registrationNumber

String colour

int warrantyDist

String toString ( )

Person

String name

Car car

String city

String toString ( )

 

 

 

 

 

 

 

 

1. Create a document named: surnameStudentIDAssign1.doc . In your document, you must include the following section headings: System Overview, Class Diagram, Class Descriptions, Testing.

System Overview

In the System Overview section you are to write 100-200 words describing your system and a made up use for your system in an imaginary/real world scenario. You will need to review this after completing all tasks and ensure that your overview explains your entire system. State any assumptions you are making in your system.

Class Diagram

In this section, you are to provide a class diagram for every user authored class in your system.

Class Descriptions

In this section, you are to describe each class you have written. For each class describe the instance variables as well as methods provided in that class. For each method, describe parameters (if any) as well as any output produced. Give examples of the output if appropriate. Describe the functionality achieved by each method.

Testing

As you develop your classes and methods, you will write testing code to verify that your code is working correctly. In this section, you will describe your chosen test data and explain how that data helps you test your code. Make sure that you choose a variety of test cases to ensure you can be satisfied that your code is working. Include screen shots of your testing results in this section.

Task 2 Creating your base classes

Create a new project in Eclipse called Assignment 1.

Within this project create a package called task02.

1. Authortwo new classes within your newly created package. Choose two related real world objects (similar to the Person and Car objects in the sample code provided) that you are modelling where one object might own or use or provide a service to the other object. e.g. a Person might own a Pet, a library might own a Book, a Person might hire a Video, a Teacher might teach a Student, a Coach might train an Athlete, a Dentist might treat a Patientetc.Due to this relationship, one of your objects will have a reference to the other object (similar to the Person having a Car).

2. Descriptions of each class and Class diagramsmust be entered into your document created in task1. List any assumptions you make. Describe the relationship between the classes.

3. Explain the methods that you have authored - provide a description and type of any parameters and describe the purpose for each method.

4. Give an example of output that would be produced by your method/s.

5. Explain the constructors that you have provided. You must provide at least 2 constructors:
a. A default constructor which assigns each instance variable a default value. The String variables (e.g. name) should be initialised to "unknown", and object fields initialised to null.
b. A constructor with parameters which assign values to each instance variable. Note that the values to initialise the values and objects should be passed in using argumentswhen the constructor is called - the fields should not be instantiated in the constructor.

6. Author get and set methods for your classes for each instance variable.

7. Write a toString method that will return a String containing all the relevant data for each of your objects.

8. Create a new Test01 class. In this class, provide a main method containing code to test both constructors, at least one get and one set method and your toString method.Run your test and make sure your class is behaving correctly.

9. In your documentation, explain how you have tested your code and the results of your testing. Include screen shots demonstrating the output when you tested your code.

Task 3 New objects based on extending other objects

1. Create a new second package, called task03, within the project Assignment 1. In this class you will create two new classes that extend classes from the package task02. It is likely that you will be able to say your subclass ‘IS A' special type of your superclass. For example, A HireCar IS A Car, similar to HireCar which extends the class Car and A Customer ISA Person, Customer extends task01.Person in the sample code you were provided. Be creative and think of two(2) new classes that can extend yourexisting classes.

a. One of the new classes must be based on a reference extending an existing class from package task02 directly(similar to how Customer extends Person in the sample code).Do not repeat that package task02 class in the task03 package.

b. With the second new class, you may create a modified copy of your original class from package task02 in task03. Modify that copy of the original class so that it cannot be instantiated alone, but only the new class can be created.

Discuss your choice of classes and sub-classes with your tutor during a labclass prior to week 5.

2. Some further descriptions and class diagrams of classes in the sample code are provided in Appendix A. Refer to the sample code you were provided. Read these and understand them, then you need to create class diagrams for your own system and add descriptions of your new classes to your report document.

3. In your new classes, create at least 2 new methods that act on the new objects e.g. by performing a calculation based on the data in the object.Document these methods in your report.You may need to be creative with the instance variables you associate with your objects to think of a calculation you can provide. If you have any difficulty with ideas, discuss this with your tutor.

4. Test your classes to check they are working correctly. Document your testing process - describe your test data and the outcome of your testing. Include screen shots in your report document illustrating your testing process and the outcome of your testing.

Reference no: EM13317731

Questions Cloud

Determine the magnitude of the current : A circular conducting loop with a radius of 0.30 m and a small gap filled with a 10.0 ohm resistor is oriented in the xy-plane. what is the magnitude of the current that will be caused to flow in the conductor
What is the slope of the budget line : PUBP720: Managerial Economics - Make the first order partial derivatives of the Lagrangian and set them to 0 - What is the slope of the budget line? Does the slope of the budget line depend on consumer preferences? Why or why not?
What is the expected annual savings and expected pw : An energy efficiency project has a first cost of $300,000, A life of 10 years, and no salvage value. Assume that the interest rate is 9%. The most likely value for annual savings is $60,000.
What is the original speed of the son : A father racing his son has two-fifths the kinetic energy of the son, who has three-fifths the mass of the father. The father speeds up by 1.0 m/s, What is the original speed of the son
Provide a class diagram for every user authored class : Examine the sample code you have been provided with. This code is for a simple Car Hire management system. It contains a number of classes.
What is the discharge through the pipe for water temperature : A fire hydrant is supplied through a 6 inch cast iron pipe of 16,000 feet length. The total drop in pressure is limited to 35 psi. What is the discharge through the pipe for a water temperature of 80°F ((kinematic viscosity) = 0.93 × 10-5 ft2/sec)
What would be the reduction in length of the sample : A core sample of basalt, 4 inches long and 2 inches in diameter, was tested in unconfined compression. The basalt is known to have a modulus of elasticity = 9.1 x 106 psi.
Determine by what factor does the rate of heat flow change : Two metal rods of equal length-one aluminum, the other stainless steel-are connected in parallel with a temperature of 16.0%u2218C at one end and 126%u2218C at the other end, by what factor does the rate of heat flow change
What is its greatest distance from the sun : A comet has a very elliptical orbit with a period of 124.0 y. If the closest approach of the comet to the Sun is 0.09 AU, what is its greatest distance from the Sun

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a sumo robot c program

Write a sumo robot c program for an aduino board, using 2 motors. 2 phototransistors and 2 Led sensors( sensors 2 for the front and 2 for the back ) which are going to be responsible for keping the robot in the sumo ring, making sure the robot com..

  Write a program that asks user to enter

Write a program that asks user to enter the size of the matrix (rows and column) then, it asks the user to enter the elements of two matrices and finally it adds two matrix and displays the result in C language.

  To reverse the order of elements on a stack

Write a program in C++ to  reverse the order of elements on a stack S using two additional stacks using one additional stack

  Implement circular linked list in c program

implement circular linked list in c program in the best possible easiest way.

  Design and write a c++11/fltk game program

The project is to design and write a C++11/FLTK game program with a graphical user interface. The game is based on "pancake sorting," which actually has some mathematical significance.

  Generate a two-dimensional array

Generate a two-dimensional array of integers of 10 rows by 10 columns that contains 100 random numbers between 0 and 9. Print out the array (well formatted) and do the following computations

  Implement the vector class using inheritance

Is it better to implement the Vector class using inheritance (is-a relationship) or composition (has-a relationship). In other word, which one of the following gives a better implementation?

  Write me a function that finds the smallest item in an array

Write me a function that finds the smallest item in an ArrayBag (by reference) and returns true if the arrayBag is not empty and false otherwise.

  A store with a bag of groceries

write C++ statements that remove all the items from storeBag and place them into one of two new bags, as follows: Place all occurrences of bread and eggs into fragileBag, and all other items into groceryBag. When you are done, storeBag should be empt..

  Create the appropriate constructor, getters and setters

Create the appropriate constructor, getters and setters for the class. Create an instance of Student for each of the students listed above from array. Construct the instance with lastname, firstname, and job.

  Write a program that uses a loop to display projected rates

Write a program that will convert US dollar amounts to Canadian dollar (1 CND = 0.92 USD). Format your currency amounts in two decimal places and trailing zeros.

  Write a function named dietoss that simulates the tossing

Write a function named dieToss that simulates the tossing of two dice. When you call the function, it should generate two random numbers ranged in 1 to 6 and return the sum of the die's numbers. In the mail program, ask user how many times the dice s..

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