|University||Skyline College (SC) Canada|
|Subject||COMP 155: Computer Programming Visual Basic|
In this individual project, you are going to design a small Java program simulating the consumption of gas mileage of an automobile during road trips under various scenarios;
Factors you must include in your program:
- User options for a nation and a city (i.e., New York City street has different overall road conditions from Beijing in China).
- User options for the types of cars and manufacturers (4-door passenger, SUV, 2-door sports car, etc.). Minimum 3 different cars.
- User options for different road conditions (flat street, bumpy, mud, forest, construction site, etc.)
- User options for the weather (sunny, rainy, snow, etc.)
- User options for a number of passengers
- No user input necessary. Simply generate a random number of traffic lights and stop signs during driving.
- Come up with your own factor affecting a gas mileage
Note: You must define separate Java classes (one java file showing main( ), and another Java files showing the class design with constructors; e.g., Car.java) along with multiple separate functions to incorporate these factors affecting total gas consumption calculation.
Here is one sample scenario:
- User inputs to define the maximum distance to travel and options from 7 factors.
- A random number of traffic lights and Stop signs (minimum 4)
- On each traffic intersection, a random color signal will be displayed (among red, yellow, or green) across all traffic light locations.
- Define a rule of gas mileage consumption (MPG) when a car confronting a different situation of a traffic light based on three different color signals. if the Greenlight, pass. No extra gas wasted.
- if the Red light or stop sign, stepping on the brake pedal adds an extra gas mileage.
- If the Yellow light, step on the brake pedal to slow it down. Compare to the complete stop, you waste less gas.
- To estimate the mileage of your favorite car, review the U.S. Department of Energy site showing different auto manufacturer and its mileage
- Information about Miles Per Gallon
- Incorporate more variables (from previous slides up to 7) to build a realistic simulation of gas mileage(i.e., road condition, number of passengers, etc.).
- Your output summary should display the following (including 7 factors):
- Location (city, nation)
- Type of car which a user chooses
- Number of passengers
- Total traffic lights and stop signs and distance between traffic lights.
- Road condition
- Total Gas mileage
- You must define separate Java classes (one java file showing main( ), and another Java files showing the class design with constructors; e.g., Car.java) along with multiple separate functions to incorporate these factors affecting total gas consumption calculation. One of your Java files should be named DrivingSimulation_yourLastnameInitial.java