Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

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.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M9897041
  • Price:- $70

Priced at Now at $70, Verified Solution

Have any Question?


Related Questions in C/C++

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As