Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Programming Fundamentals Project Project 1: Vehicle Simulator INTRODUCTION Your knowledge on Java Syntax is already good enough to create a small universe. This universe
Programming Fundamentals Project Project 1: Vehicle Simulator INTRODUCTION Your knowledge on Java Syntax is already good enough to create a small universe. This universe is full of different types of vehicles on the field. Outside of the field is a cliff. Any vehicle that went outside of the field is dead. The field is divided into 4 different quadrants. In the beginning of the application, vehicles must be randomly populated on one of those quadrants. While the simulation will last for a certain number of turns, vehicles will move slightly each turn depending on its type. When the simulation ends, it will display the location of each vehicle, list of dead vehicles and which quadrant they are/were in. OBJECTIVES The main objectives of this project are to: 2 3 1 Interpret specifications and analysis performed Design a solution based on the requirements and specifications Design the logic required for functional solution Translate design documents and algorithms into source code Use debugging tools, and error-handling techniques Validate the solution with test data TIME REQUIRED You will require 30 hours to complete this project. These hours include 5 in-class sessions plus homework time to complete the application Integrate the knowledge acquired thus far Use the features of Eclipse IDE Demonstrate the use of the Java programming language. Apply the various program flow constructs. REQUIRED MATERIAL You will need the following material to complete this project: Eclipse 2019-06 Java SE 8 Development Kit (JDK) SPECIFICATIONS This simulation is all about the architecture and functionality not the appearance. Providing GUI is a bonus. This application requires you to use specific polymorphism structure, composition, inheritance. Certain methods will require you to use exception handling. When the application starts, the console will prompt the user to input following values: Length of each quadrants. Number of vehicles. Number of each vehicle type. When the specifications are done, program initialized the field and populate the vehicles (Car, Truck, SportsCar, Tractor) of random types in a random position in random quadrants. Coordinate of the center of the field is always (0, 0), each quadrant is always a right triangle and length of each quadrants are all same. All vehicles move in their own pattern each turn. Details will be specified later. OOP Java Knowledge When all the vehicles are dead, User should be able to see top 3 vehicles of each kind that lasted the longest and the details of those vehicles. KEY FUNCTIONS The main functions of the simulator may be summarized as follows: Use Prompt Input Simulation / Display each turn Display Results at the end DETAILED GUIDELINE/REQUIREMENTS Following is a guideline to implement the simulator. Object-Oriented design has to be implemented as follows due to the objective of this course. Vehicle abstract class Superclass for all vehicles. Properties: X coordinate (int), Y coordinate (int), alive (Boolean) Constructor to initialize all properties. Move Method: a) Called for all alive vehicles each turn b) Increments or decrements either x or y coordinates by 1. Any type of vehicle should throw an exception if the move method is invoked even when the vehicle is dead.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Code import javautilScanner abstract class Vehicle int xCoordinate int yCoordinate boolean alive Vehicleint x int y boolean alive xCoordinatex yCoordinatey thisalivealive public abstract void move pub...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