Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question: 1. Using Object-oriented Programming approach, develop a CH program for a shipping company to manage their inventory of ships. The company keeps the following

image text in transcribed
image text in transcribed
image text in transcribed
Question: 1. Using Object-oriented Programming approach, develop a CH program for a shipping company to manage their inventory of ships. The company keeps the following information about each ship: a. The name of the ship b. The year that the ship was built c. The address that the ship was registered at. It includes the country where the ship was registered and the registrar office that keeps the registration record. The UML class diagram for the inventory system is given as in Figure 1.0. In Address class, the function set is a mutator used for specifying the member variables, registrar and country, with values obtained from the function's arguments, while the functions getRegistrar and getCountry are accessors. As for the class Ship, the function read is a mutator that specifies all the member variables, name, yearMade and address, with values obtained from the keyboard. The function print on the other hand, is used to print the member variables. Ship Address .name: string - registrar: String -year Made: string - country: string address: Address + Ship () + Address 0 + print(): void + set(string, string): void + read(): void Figure 1.0 Class diagram for the ship inventory system The implementation of your program must be based on the class diagram and specifications given above. Also, your program should use a dynamically allocated array to store the list of ships. Furthermore, the program should provide a menu-driven internetion for the user to use the program. It should allow the user to add the record for * ship one at a time. It should also provide an operation to display the number of ships and the information of each ship. Figure 2.0 illustrates an example run of the program. Note that the bold texts represent user inputs. MENU 1. Add a ship 2. Display ships 3. Exit Choose an operation => 1 >> Ship Name: Super Gemilang Year Built: 2010 The address the ship was registered: Registrar office: Malaysian Shipping Council Country: Malaysia Press any key to continue ES MENUS 1. Add a ship 2. Display ships 3. Exit Choose an operation => 1 >> Ship Name: Orion Cruise Year Built: 2000 The address the ship was registered: Registrar office: Shipping Authority Board Country: Singapore Press any key to continue... == MENU = 1. Add a ship 2. Display ships 3. Exit Choose an operation => 2 > Ship Name: Super Gemilang Year Built: 2010 Registered at: Malaysian Shipping Council, Malaysia Ship Name: Orion Cruise Year Built: 2000 Registered at: Shipping Authority Board, Singapore Press any key to continue... - MENU 1. Add a ship 2. Display ships 3. Exit Choose an operation => 3 Figure 2.0: Example run Attention for the exercise: 1. You need to put your name and the description of the program at the top of your cpp file in the lab exercises. 2. You are also are required to give some comments regarding the program as your documentation

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions

Question

10. The graphics card was installed incorrectly on your computer.

Answered: 1 week ago

Question

Effective Delivery Effective

Answered: 1 week ago