Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Due: Wednesday, Mar. 2 7 , 2 0 2 4 @ 1 1 : 0 0 am , soft copy in Moodle. Maximum: 1 0
Due: Wednesday, Mar. @ : am soft copy in Moodle. Maximum: points The following program is developed in two phases as following: Phase Inheritance: You are a beginner programmer where you are asked to develop a video game called SimCity. The game simulates a metropolitan city where it has various transportation means. As a start, your team leader asks you to write a code that describes cars, planes, and trucks objects. The type of a vehicle is to be decided at runtime in the game. Each vehicle should have a position, size, and cost. Also, a common operation is move in addition to the setters and getter of the common attributes. In the game, Cars and Trucks move in D plane, while airplanes move in D space. You are free in your design to select the specific attributes and methods for each vehicle type. However, you are asked to follow the OOprogramming principles such as modularity, SW component reuse, information hiding, encapsulation, and polymorphism. Phase Interface: As a second step of developing SimCity game, you are sked to integrate other items into the game, such as Buildings, Roads, and Trees. The common attributes of these items are position, size, and cost, same as above, in addition to the setters and getter of the attributes. In the game, Roads is represented in D images, while Buildings and Trees are represented in D images. You are free in your design to select the specific attributes and methods for each item type. However, you are asked to follow the OOprogramming principles such as modularity, SW component reuse, information hiding, encapsulation, and polymorphism. You are asked by your team leader to integrate the new items with the transportation vehicles, such that any type of those items in phase or phase is added into the game at run time polymorphically The designcode of phase may change after incorporating phase to it The final submission should include the enhanced design for both phase and phase combined. Therefore, no need to submit phase alone. You need to provide the UML class diagram for your whole design phase and combinedImportant Notes: Items in D require only and coordinates, while items require and coordinates. Therefore, setting position and size for D items differ than those of items. The same idea for method move, where a vehicle moves in D space vs in D space. The variable position represents one point in space either in D plane or D space. The variable size in is measured by meter square, where in is measured by meter cube. You can place an item in any place, however the item size must be contained within the item position. The cost is by SimCity currency units. Testing Setup: Create a drivertest class where it should contain a space of your defined size. This space is in D think of it as a box, and you should select one plane side to be the ground. All objects must be contained inside this space which we will call the "game space". Produce multiple objects of each kind and place them in the game space. However, you have to consider the following restrictions: Objects of type Road, Tree, Building, Car and Truck should be placed in the ground plane only. If the object type is Road, Tree or Building, then space overlapping is restricted. Meaning, you cannot place an object of these types on top of each other. You have to make sure that the position is not occupied from these types of objects first. You need a way to compare between objects positions. Testing steps: After creating the objects, output each object's type and information position size and cost to the screen. Show if there are some objects that were not added to the game because of an overlapping space conflict with already existing items. Test operation move to all vehicles. Cars and Trucks move only on roads in D space, whereas, planes move vertically in D space. Show the information of the objects after moving some vehicles.
Due: Wednesday, Mar. @ : am soft copy in Moodle.
Maximum: points
The following program is developed in two phases as following:
Phase Inheritance:
You are a beginner programmer where you are asked to develop a video game called SimCity.
The game simulates a metropolitan city where it has various transportation means. As a start,
your team leader asks you to write a code that describes cars, planes, and trucks objects. The
type of a vehicle is to be decided at runtime in the game. Each vehicle should have a
position, size, and cost. Also, a common operation is move in addition to the setters
and getter of the common attributes. In the game, Cars and Trucks move in D plane, while
airplanes move in D space. You are free in your design to select the specific attributes and
methods for each vehicle type. However, you are asked to follow the OOprogramming
principles such as modularity, SW component reuse, information hiding, encapsulation, and
polymorphism.
Phase Interface:
As a second step of developing SimCity game, you are sked to integrate other items into the
game, such as Buildings, Roads, and Trees. The common attributes of these items are
position, size, and cost, same as above, in addition to the setters and getter of the
attributes. In the game, Roads is represented in D images, while Buildings and Trees are
represented in D images. You are free in your design to select the specific attributes and
methods for each item type. However, you are asked to follow the OOprogramming principles
such as modularity, SW component reuse, information hiding, encapsulation, and
polymorphism.
You are asked by your team leader to integrate the new items with the transportation vehicles,
such that any type of those items in phase or phase is added into the game at run time
polymorphically
The designcode of phase may change after incorporating phase to it The final
submission should include the enhanced design for both phase and phase
combined. Therefore, no need to submit phase alone.
You need to provide the UML class diagram for your whole design phase and
combinedImportant Notes:
Items in D require only and coordinates, while items require and
coordinates. Therefore, setting position and size for D items differ than those of
items. The same idea for method move, where a vehicle moves in D space vs in D
space.
The variable position represents one point in space either in D plane or D space.
The variable size in is measured by meter square, where in is measured by
meter cube.
You can place an item in any place, however the item size must be contained within the
item position.
The cost is by SimCity currency units.
Testing Setup:
Create a drivertest class where it should contain a space of your defined size. This space is in
D think of it as a box, and you should select one plane side to be the ground. All objects must
be contained inside this space which we will call the "game space". Produce multiple objects of
each kind and place them in the game space. However, you have to consider the following
restrictions:
Objects of type Road, Tree, Building, Car and Truck should be placed in the
ground plane only.
If the object type is Road, Tree or Building, then space overlapping is restricted.
Meaning, you cannot place an object of these types on top of each other. You have to
make sure that the position is not occupied from these types of objects first. You need a
way to compare between objects positions.
Testing steps:
After creating the objects, output each object's type and information position size and
cost to the screen.
Show if there are some objects that were not added to the game because of an
overlapping space conflict with already existing items.
Test operation move to all vehicles. Cars and Trucks move only on roads in D space,
whereas, planes move vertically in D space.
Show the information of the objects after moving some vehicles.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started