Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Prepared by: David Chisanga XXXXXXXXXXModerated by: Dr Javed Ali Baloch November, 2017 Assessment Details and Submission Guidelines Trimester T1 2018 Unit Code BN108/BN108D Unit Title Programming for...

1 answer below »
Prepared by: David Chisanga XXXXXXXXXXModerated by: Dr Javed Ali Baloch November, 2017
Assessment Details and Submission Guidelines
Trimester T1 2018
Unit Code BN108/BN108D
Unit Title Programming for Networking
Assessment
Type
Individual
Assessment
Title
Interactive programs
Purpose of the
assessment
(with ULO
Mapping)
This assignment assesses the basic concepts of programming; students should
e able to demonstrate their achievements in the following unit learning
outcomes:
a. describe the fundamental principles of object-oriented programming;
. interpret a user’s needs while dealing with simple program specifications;
c. design a simple class using UML notation;
d. create a simple application based on UML design and the incremental
development process of coding, debugging, and
testing;
e. apply basic control structures – sequence, repetition, and selection – to
program development;
f. produce simple interactive applications.
Weight 25%
Total Marks 50 marks
Word limit Not applicable
Due Date 30/05/2018 5:00PM
Submission
Guidelines
 All work must be submitted on Moodle by the due date along with a
completed Assignment Cover Page.
 The assignment must be in MS Word format, 1.5 spacing, 11-pt Cali
i (Body)
font and 2 cm margins on all four sides of your page with appropriate section
headings.
 Reference sources must be cited in the text of the report, and listed
appropriately at the end in a reference list using IEEE referencing style.
Extension  If an extension of time to submit work is required, a Special Consideration
Application must be submitted directly on AMS. You must submit this
application three working days prior to the due date of the assignment.
Further information is available at:
http:
www.mit.edu.au/about-mit/institute-publications/policies-
procedures-and-guidelines/specialconsiderationdeferment
Academic
Misconduct

 Academic Misconduct is a serious offence. Depending on the seriousness of
the case, penalties can vary from a written warning or zero marks to exclusion
from the course or rescinding the degree. Students should make themselves
familiar with the full policy and procedure available at:
http:
www.mit.edu.au/about-mit/institute-publications/policies-
procedures-and-guidelines/Plagiarism-Academic-Misconduct-Policy-
Procedure. For further information, please refer to the Academic Integrity
Section in your Unit Description.
http:
www.mit.edu.au/about
http:
www.mit.edu.au/about
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/special-considerationdeferment
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/special-considerationdeferment
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/special-considerationdeferment
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/special-considerationdeferment
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/special-considerationdeferment
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/special-considerationdeferment
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/special-considerationdeferment
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/special-considerationdeferment
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/special-considerationdeferment
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/special-considerationdeferment
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/special-considerationdeferment
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/Plagiarism-Academic-Misconduct-Policy-Procedure
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/Plagiarism-Academic-Misconduct-Policy-Procedure
http:
www.mit.edu.au/about-mit/institute-publications/policies-procedures-and-guidelines/Plagiarism-Academic-Misconduct-Policy-Procedure
BN108D/BN108 Programming for Networking P a g e | 2

Prepared by: Umesh Poudel Moderated by: Dr Javed Ali Baloch May 2018
Assignment Description
This assignment will give you practice with interactive programs, if/else statements, a
ays, loops and
methods.
Problem Description
A small car yard dealing in second hand cars needs an application to keep records of cars in stock. Details of
each car shall include id (unique for each car), model, year of manufacturing, price paid for the car (i.e.
purchase price) and selling price.
Selling price is calculated as old price plus mark-up of 30%. For example, Ford Transit bought for $20,000 will
have the selling price of 20000 * XXXXXXXXXX) = 26000.
The car yard does not buy cars manufactured before 2009.
Task Requirements
Imagine you have been invited to develop a menu driven java application to manage records of cars in stock.
Familiarise yourself with the problem description provided above and complete the following tasks.
1. Develop a UML class diagram based on the problem description. The name of the class must be Car
a. Identify all the required attributes (includes id and selling price) for the Car class.
. Identify a constructor for the class. Attributes id and selling price are calculated fields and should
not be included as constructor parameters.
c. Identify all the set and get methods for each of the attributes identified in 1.a
2. Write a Java implementation of the UML diagram defined in 1. In your class, include comments describing
the function of the class, the name of the programmer and the date of implementation.
3. Write a Java program (driver class) named CarYardMITnnnnn (nnnnn is your MIT ID) with a main method.
Within the main method, design and implement the menu driven program functions of buying, selling,
displaying and terminating the program as described below. Include comments describing the function of
the program, the name of the programmer and the date of implementation.
a. Declare all required variables including the list of cars (a
ays/A
ayList) as static variables.
. Include static methods to implement buy, sell, and display functions
BN108D/BN108 Programming for Networking P a g e | 3

Prepared by: Umesh Poudel Moderated by: Dr Javed Ali Baloch May 2018
c. Populate the list of cars (a
ays) on start-up with three car objects of your choice which should be
displayed when user selects option three (3) from program Menu.
d. Program displays a main menu on execution and allows user to interact with the program until
the user selects menu option four (4) which terminates the program.
Description of Program functions
Program displays a menu on execution. Four menu options are available to allow the user to buy a car, sell a
car, display all cars, and exit program respectively. Program functionality and screen output for each of the
menu option when selected by the user follows:
Program menu on execution:
~~~ Main Menu ~~~
1. Buy Car
2. Sell Car
3. Display all cars
4. Exit
Enter menu choice (1-4):
Invalid menu choice: User enters 5
~~~ Main Menu ~~~
1. Buy Car
2. Sell Car
3. Display all cars
4. Exit
Enter menu choice(1-4): 5
Invalid menu choice: 5
Buy a car (option 1): User enters 1. Note the e
or message for year before 2009
~~~ Main Menu ~~~
1. Buy Car
2. Sell Car
BN108D/BN108 Programming for Networking P a g e | 4

Prepared by: Umesh Poudel Moderated by: Dr Javed Ali Baloch May 2018
3. Display all cars
4. Exit
Enter menu choice(1-4): 1
--- Buy Car ---
Enter model name:
Mazda
Enter Year:
2008
E
or! The car yard does not buy cars manufactured before 2009.
Enter Year:
2009
Enter price: $
10000
New car added: Mazda (2009)
Sell a car (option 2): User enters 2. Note the e
or message for invalid car id
~~~ Main Menu ~~~
1. Buy Car
2. Sell Car
3. Display all cars
4. Exit
Enter menu choice (1-4): 2
--- Car Details---
Enter Car id:
101
Model: Honda
Year: 2012
Purchase Price: $20000.0
Selling Price: $26000.0
--- Car Details---
Enter Car id:
BN108D/BN108 Programming for Networking P a g e | 5

Prepared by: Umesh Poudel Moderated by: Dr Javed Ali Baloch May 2018
99
No match found for car ID:99
Display all cars (option 3): User enters 3
~~~ Main Menu ~~~
1. Buy Car
2. Sell Car
3. Display all cars
4. Exit
Enter menu choice (1-4): 3
--- Car List ---
1:
ID: 100
Model: Toyota
Year: 2009
Price: $10000.0
2:
ID: 101
Model: Honda
Year: 2012
Price: $20000.0
3:
ID: 102
Model: Subaru
Year: 2015
Price: $30000.0
Exit Program (option 4): User enters 4
~~~ Main Menu ~~~
1. Buy Car
2. Sell Car
3. Display all cars
4. Exit
Enter menu choice (1-4): 4
Terminating...
BN108D/BN108 Programming for Networking P a g e | 6

Prepared by: Umesh Poudel Moderated by: Dr Javed Ali Baloch May 2018
Marking criteria:
Marking criteria is shown in following table. Marks are allocated as follows:
Description of criteria Marks
Task 1: Develop a UML class diagram [5 marks]
Identify all the required attributes

2
Identify a constructor for the class

1
Identify all the set and get methods

2
Task 2: Write a Java implementation of the UML class diagram [10 marks]
Java class implementation consistent with the UML class model

10
Task 3: Write a Java program (driver class) [25 marks]
Declare all required variables as static variables

3
Include static methods to implement buy (4), sell (4), and display (4) functions. Screen
outputs consistent with the samples provided

12
Program displays a main menu and is interactive. 5
Implements a loop to allow the program to continue running until the user quits

5
Others [10 marks]
Use whitespace properly to make program more readable, such as between operators
and their operands, between parameters, and blank lines between groups of
statements or methods.

2
Give meaningful names to methods and variables in your code.

2
Your program compiles successfully without any e
ors

4
Includes comments described in the program description

2
Total

50


BN108D/BN108 Programming for Networking P a g e | 7

Prepared by: Umesh Poudel Moderated by: Dr Javed Ali Baloch May 2018
Marking Ru
ic for Assignment #: Total Marks 50
Grade
Mark
HD
40-50
DI
35-44
CR
30-34
P
25-29
Fail
25
Excellent Very Good Good Satisfactory Unsatisfactory
Task1

5
UML class diagram is
well done and is
consistent with the
equirements.
UML class
diagram is
consistent
with the
equirements
Generally
consistent
with the
equirements
ut can
improve
UML class
diagram misses
some
equirements
Not attempted or
design effort is
inco
ect
Task 2

10
Java implementation
Answered Same Day May 17, 2020 BN108/BN108D

Solution

Ujjawal answered on May 24 2020
139 Votes
/**
* Represents a car
* Date of implementation: 22 May 2018
*
*
public class Car {
    /**
     * Id of ca
     *
    private String id;
    /**
     * Car model
     *
    private String model;
    /**
     * Manufacturing year of ca
     *
    private int manufacturingYear;
    /**
     * Cost price of ca
     *
    private double costPrice;
    /**
     * Selling price of ca
     *
    private double...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here