Parking simulator Java application interface and payment system design
✍️ How to write this paper — guide & tools ▾
Java Application (parking Simulator)
Interface description
Form
When user launches the application the form1 appears. From form1 we can go to parking form by clicking on "Park." Actions of "Park" button will be viewed later. By the use of panel menu we can do the following:
File-exit - exits the application
Change statistics->Coins available- calls from2 that shows coins available in parking machine
Clicking on button "OK" returns user to Change statistics->Add funds calls form3 that allows to add funds to the machine
Form4
By clicking on park button on form1 user gets to the form4 which shows parking actions. Here the driver has to choose number of hours and pay for them. He can view the indicator of current time and ending time of parking for which he is supposed to pay. Also the form shows the amount that has to be paid and the amount the driver had already paid. If user makes a mistake in inputting data either for parking time or for amount paid he can cancel payment and will be returned to the form1. In the upper section of the window there are coins of different value for parking payment. By clicking on these coins user will pay corresponding amount of money for parking. When payment is complete buttons become unavailable- user can not add any more money. After the payment is complete and user had paid more than it is supposed, he will get a change menu message form5.
Form5.
On the change menu he can choose the way he want to get change in different variants. He can also watch the change available. After he chooses the variant of payment the program checks for available funds and if the funds are unavailable program gives an error message-Form6
Form6
Then the application returns user to form1.
The data about parking payments can be viewed from report file or in the menu: Change statistics->General statistics Form7
Form7
Information about payments is saved into dynamically creating file Report.txt for future analysis and identification of machine's errors.
Possible mistakes in program and the methods used to solve them.
During the developemnrt of the project the developer met set of mistakes, that were fixed. They refer to different aspects of program development:
1) While working with real variables (float type), after calculations unwanted errors appeared, which caused incorrect work of the application:
for example: Amount=Amount+ (float)0.5 caused incorrect result of the following time:
amount=4.
This mistake was corrected in the following way:
Amount=(float)((Math.rint ((double)Amount*100+(double)0,5*100))/100);
So the numbers were transformed to integers and they were used in math operations like integers, then they were transformed back to real. This was one of the most widely spread errors in the program which was corrected successfully.
2) for date defining data was taken from computer's current profile, but current profile could be set incorrectly. That's why the profile was changed on the profile of UK:
formatter = new SimpleDateFormat ("hh:mm," Locale.Default);
formatter = new SimpleDateFormat ("hh:mm," Locale.UK);
3) When data was recorded into text file, it was recorded as one line whch was very inappropriate for analysis and for viewing
This error was fixed by.newLine () method;
4) During file recording in "OK" button code on form of parking payments the file was rerecorded without saving previous operations (every operation was rerecorded even if the application was still working).
The mistake was fixed by moving.close () method into the exit application section of program's code.
5) Parking payment counter showed the payment for every next payment step.
Error was fixed by adding time counter into every button.
6) When paying for parking user could input superfluous coins (which would require eternal change calculations, etc.)
The error was solved by calculating the difference between paid hours and ordered hours.
7) in order to make programs code shorter all possible change variants were counted:
Change (10,20,30,40,50,60,70,80,90, 1.30,1.40,1.50,1.60,1.70,1.80,1.90)
Project description:
Project was developed in Borland Java Builder 5.0
Park- project folder
Park.jpx- project's java file (with annotations)
Main classes:
ClassesParkapplication1
ClassesParkframe2
Report.txt- parking payment report file
Literature used:
Calvert, Charlie Calvert's Learn JBuilder Wordware Publishing 2002
Landy, Michael and others Borland JBuilder Developer's Guide Sams 2002
Zukowski, John Borland's Jbuilder: No Experience Required (No Experience Required Series) Symbex Inc. 1998
Create your account
Always verify citation format against your institution’s current style guide requirements.