This program allows a user to input information about food trucks, and then allows them to choose information to display about the trucks. The program uses two classes. One class for the food truck objects, and a second class for user input/output and calculations. The main method of the FoodTruckApp class is the only static method, and mainly just creates an instance of FoodTruckApp and calls its methods.
- Java OOP
- objects
- classes
- visibility
- encapsulation
- arrays
- toStrings
The main things I learned while doing this project were how to structure a program when using multiple classes, using public/private, and using static vs non static fields and methods. Aside from those topics, the most interesting individual problems were 1. dealing with ties in the highest rated trucks and 2. formatting the toString for the FoodTruck class so that all of the information would be aligned nicely.
- The user will be prompted to enter information for up to five food trucks. If the user enters "quit" as the name for a food truck, the remaining inputs will be skipped
- A menu will be displayed giving the user various options. They will be able to keep entering options until deciding to exit.
- Display information for all the trucks
- Display the average rating for the trucks
- Show the highest rated truck(s)
- Exit the program