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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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