5/5 – (1 vote)
- Java application to accomplish the following task:Ask users to input the amount of tax they paid for the past 3 years.
- put the information to a text file.
After you are done, zip compress the text file and the java source file along with screen shot of your output, and submit.
- It must Use proper data structures in the program.
- Know how to write data to a text file.
- Use proper exception handling techniques to protect against file I/O errors.
Please note
The BufferReader classs readLine method returns a line from a file as a String. If you need to perform calculations, you will need to convert the String object into a number. You can use a wrapper class to convert.
These methods are:
Methods Purpose Example
Integer.parseInt Convert a String to an int int num=Integer.parseInt(str)
Double.parseDouble Convert a String to a double double num=Double.parseInt(str)
Byte.parseByte Convert a String to a byte byte num=Byte.parseByte(str)
Float.parseFloat Convert a String to a float float num=Float.parseFloat(str)
Long.parseLong Convert a String to a long long num=Long.parseLong(str)
Short.parseShort Convert aString to a short short num = Short.parseShort(str)
Reviews
There are no reviews yet.