Combo Offer 35% Off + 10% Extra OFF on WhatsApp

Menu Driven Program In Java Assignment Sample

  • Plagiarism & Error Free Assignments By Subject Experts
  • Affordable prices and discounts for students
  • On-time delivery before the expected deadline

No AI Generated Content

72000+ Projects Delivered

500+ Experts

Enjoy Upto 35% off
- +
1 Page
35% Off
AU$ 11.83
Estimated Cost
AU$ 7.69
Securing Higher Grades Costing Your Pocket? Book Your Assignment At The Lowest Price Now!
X

(i) Project Background

The project is done in Java programming language with the help of the Eclipse software. Java is a very high level, object oriented, class based language of programming that is used for a wide array of coding problems. Java is designed to work on its implementation with very few dependencies as possible (Aldriye et al. 2019). Eclipse is a type of environment for development that is integrated with many possible libraries and functionalities. Within the Eclipse workspace, one can find a basic workspace with additional options to add plugins. This extensive plugin system is necessary for customization of the development environment.

Class distribution diagram

Figure 1 : Class distribution diagram

(Source - Self created on draw.io)

This project solves the problem of rash driving and speeding by imposing penalties, demerit points and fines to drivers who are identified to be driving at an excess speed than the specified speed limit. To discourage and spot very risky driving, the Police frequently monitor the roads. Drivers who often violate the law face severe consequences, such as demerit points, fines, and immediate license suspensions. In NSW, a driver with an unrestricted license starts out with zero demerit points (Bakare & Enoch, 2019). The driving record is updated if the drivers are found guilty of an offense that has a demerit point penalty. The license is suspended if the driver accrues more than the maximum number of demerit points permitted for the license within a three-year period. A Notice of Suspension is delivered to unrestricted NSW driver license holders who accumulate or surpass thirteen demerit points, or they are denied a license if they attempt to renew one. Alcohol and drug offenses, violations involving large vehicles, violations involving motorcycles, violations involving seat belts and kid restraints, violations involving street racing, and violations involving unlicensed driving are only a few examples of driving offenses.

Concerned About Completing Your Academic Project?
Connect with us for professional support and guidance.

Flowchart diagram of switch case

Figure 2 : Flowchart diagram of switch case

(Source - Self created on draw.io)

This project asks the user to implement a menu-driven program written in Java in order to take the excess speed as input and then calculate the fine, license suspension status and demerit points according to that.

(ii) Program Requirements

This section specifies the five different functions that are to be done in the menu driven part of the program. Here the functionality of the different parts of the menu driven program is explained in detail. The menu driven program is divided into five parts. The first case takes the driver data and prints it (Mashhadi & Hemmati, 2021). This data contains the license number, first , last , address, license class and status. Then comes the next section which is used to import the infringement file and print the values of that file which include the infringement number, license number, date of infringement and excess speed values. The records are matched against the driver details and then processed.

Enjoy Additional Savings on WhatsApp order!
Scan the QR code with your mobile to unlock an exclusive offer! use my discount
scan qr code from mobile

Menu Driven Program in Main class

Figure 3 : Menu Driven Program in Main class

(Source - Self created on Eclipse IDE)

Then the values are updated into the Driver file and stored in the secondary storage. After that is the portion which takes the excess speed as input and generates the suspension report based on that which includes the fine imposed, license suspension status and the demerit points of the drivers (Ortin et al. 2020). After that, the next case works on saving the updated file into a new file that contains all the updated values of infringement and the required driver details as well. Finally the fifth case mentions a clause to terminate the program as per the user choice. The default case specifies a message if the user choice input is invalid or wrong. In menu driven programs users are provided with choices from the menu as to which task is to be performed. The particular task is carried out based on the choice of the user. Menu driven programs can be done in many ways but are usually done with the help of the switch and case statements in Java. Here each case specifies one functionality based on the menu card that is printed on running the Main class.

(iii) Text Files

This portion specifies the two different text files that describe the driver details and the infringement details in a tabular format. These files contain details such as the drivers, license, demerit points, excess speed and many more. This driver data contains the license number, first , last , address, license class and status and a few other fields. The infringements data file contains the infringement number, license number, date of infringement and excess speed (Sunday et al. 2020). All this data is stored in a tabular format in the .txt file format and contains comma separated values. Data from both these files are read and stored in text files for processing and data manipulation purposes in order to solve the given problems according to the required functions of the program. Both the text files have been accessed with the help of Input and Output or IO package and the File as well as other libraries.

Driver class reading of file

Figure 4 : Driver class reading of file

(Source - Self created on Eclipse IDE)

(iv) Required Classes

This part mentions the necessary classes that are to be used for the purpose of this program. The minimum two required classes include the Driver class and the SpeedingPenalty class. The Driver class reads the driver data from the text file and prints it. The SpeedingPenalty class takes the excess speed as input and then calculates the fine, demerit points and license suspension factors. These classes are provided with necessary constructors, mutators and accessors. The SpeedingPenalty class consists of a function for calculating the fine, demerit points and license suspension status (Zhou et al. 2019). This class does not have any constructors or mutators. All the data fields in this class are initialized as static. All classes have been coded with try catch blocks in order to subdue any possible exceptions or errors.

Case 3 and Case 4  in Main class

Figure 5 : Case 3 and Case 4 in Main class

(Source - Self created on Eclipse IDE)

Output Snippets

Output when choice is 1

Figure 6 : Output when choice is 1

(Source - Self created on Eclipse IDE)

Output when choice is 2

Figure 7 : Output when choice is 2

(Source - Self created on Eclipse IDE)

Output when choice is 3

Figure 8 : Output when choice is 3

(Source - Self created on Eclipse IDE)

Output when choice is 4

Figure 9 : Output when choice is 4

(Source - Self created on Eclipse IDE)

Output when choice is wrong

Figure 10 : Output when choice is wrong

(Source - Self created on Eclipse IDE)

References

Journals

  • Aldriye, H., Alkhalaf, A., & Alkhalaf, M. (2019). Automated grading systems for programming assignments: A literature review. International Journal of Advanced Computer Science and Applications, 10(3). Retrieved From: pdfs.semanticscholar.org [Retrieved On: 07.10.2023]
  • Bakare, B. I., & Enoch, J. D. (2019). A review of simulation techniques for some wireless communication system. International Journal of Electronics Communication and Computer Engineering, 10(2), 60-70. Retrieved From: d1wqtxts1xzle7.cloudfront.net [Retrieved On: 07.10.2023]
  • Kanika, Chakraverty, S., & Chakraborty, P. (2020). Tools and techniques for teaching computer programming: A review. Journal of Educational Technology Systems, 49(2), 170-198. Retrieved From: journals.sagepub.com [Retrieved On: 07.10.2023]
  • Mashhadi, E., & Hemmati, H. (2021, May). Applying codebert for automated program repair of java simple bugs. In 2021 IEEE/ACM 18th International Conference on Mining Software Repositories (MSR) (pp. 505-509). IEEE. Retrieved From: ieeexplore.ieee.org [Retrieved On: 07.10.2023]
  • Ortin, F., Rodriguez-Prieto, O., Pascual, N., & Garcia, M. (2020). Heterogeneous tree structure classification to label Java programmers according to their expertise level. Future Generation Computer Systems, 105, 380-394. Retrieved From: www.sciencedirect.com [Retrieved On: 07.10.2023]
  • Sunday, K., Ocheja, P., Hussain, S., Oyelere, S., Samson, B., & Agbo, F. (2020). Analyzing student performance in programming education using classification techniques. International Journal of Emerging Technologies in Learning (iJET), 15(2), 127-144. Retrieved From: www.learntechlib.org [Retrieved On: 07.10.2023]
  • Zhou, Y., Yan, X., Yang, W., Chen, T., & Huang, Z. (2019). Augmenting Java method comments generation with context information based on neural networks. Journal of Systems and Software, 156, 328-340. Retrieved From: www.sciencedirect.com [Retrieved On: 07.10.2023]
Recently Download Samples by Customers
scan qr code from mobile
Get best price for your work
  • 72000+Project Delivered
  • 500+ Experts24*7 Online Help
  • AI-FreeContent
  • UnlimitedRevision

Get Extra 10% OFF on WhatsApp Order

© Copyright 2025 | New Assignment Help | All rights reserved