Reference no: EM132400122
BN108 - Programming for Networking - Interactive programs - Melbourne Institute of Technology
Assignment - Interactive programs
Purpose of the assessment -
This assignment assesses the basic concepts of programming; students should be able to demonstrate their achievements in the following unit learning outcomes:
a. Describe the fundamental principles of object-oriented programming;
b. 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.
Assignment Description:
This assignment will give you practice with interactive programs, if/else statements, collections,loops and functions.
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 registration(rego), model, color, price paid for the car (i.e. purchase price) and selling price. Selling price is calculated as purchasedprice plus mark-up of 30%. For example, Toyota Corolla bought for $20,000 will have the selling price of 20000 * (1 + 0.3) = 26000.
Task Requirements
Imagine you have been invited to develop a menu drivenpythonapplication to manage records of cars in stock. Based on the problem description, starter program (code template)has been provided.Investigate the provided starter program. There are four scripts(application.py,caryard.py, cars.py and vehicle.py). Driver function(main) is defined in the appliction.py, which imports caryard module(caryard.py). Caryard declares all the core functions (buy,sell,search, etc. ...) for supporting the car yard business. The caryard module imports cars module(cars.py), and the cars module in turn imports the vehicle that include a definition of a Car class.
Program is executed by loading and running the application.py. The important work of interconnecting and wiring of modules and functions have been already been done.However, most of these functions, although declared and wired up in the program are not yet implemented. Your task is to implement these functions. There are eleven (11) tasks to be completed described next within the modules:
1. application.py
• Task 1: implement menu ()
2. caryard.py
• Task 2: implement buy_car ()
• Task 3: implement sell_car ()
• Task 4: implement search_car ()
• Task 5: implement list_all_cars ()
3. cars.py
• Task 6: implement addCar (rego, model, color, price)
• Task 7: implement removeCar (rego)
• Task 8: implement all_cars ()
• Task 9: implement search(rego)
4. vehicle.py
• Task 10: implement the Car class
• Task 11: UML model of a Car class
Description of Program functions
Program displays a menu on execution. Five menu options are available to allow the user to buy, sell, search, show all cars, and exit program respectively. Program functionality and screen output for each of the menu option when selected by the user follows:
Attachment:- Interactive programs.rar