Question
in JAVA JAVA PLEASE JAVA********************* PLEASE READ ******************** please follow instructions and do as asked in JAVA JAVA JAVA JAVA I have this program that
in JAVA JAVA PLEASE JAVA********************* PLEASE READ ******************** please follow instructions and do as asked in JAVA JAVA JAVA JAVA
I have this program that my professor assigned to us. He has not taught us how to save files and how to do arrays as complicated as this. I need help finding how to do the code required for this. If only you can help me find the correct code to use and how to set the attributes. I need like a general code that can work as i will be imputing the movies as elements. Thank you, hope you can help me in this time of need
Assignment Description:
For this assignment, you will write a program that keeps track of your expenses, taking the information from a text file and displaying it back to you. A skeleton of the program is provided to you, which will also contain code relevant to taking data from your text data.
This purpose of this assignment is for you to understand both methods and loops fully; you will also learn how to access data from files and how to manipulate this data in various ways to display the required output. At the end, you will be given a .class file which you can run from the terminal to see the expected output and compare to your own program. We will explain how you can run the .class file this later.
Please read through all of the instructions first, before starting.
When starting the program, the user is given the following choices:
Make a log
View all logs for my previous expenses
View all logs for deposits
View all logs for a month
View Customized logs for a month
View all logs for a day
View Customized logs for a day
View all logs for a previous expenses
View all logs for a previous deposits
View all logs till date
Quit
Each option in this menu will have its own method. If the method is not already provided in the skeleton code, you will need to make it yourself. After the user chooses one option, other than to Quit, the menu will be displayed and the user will get to pick another option. This should continue looping until the user chooses to quit.
Each menu option is described below:
Option A:
For this method, the user will be able to create a log. First, ask the user if he or she would like to log (A) a deposit, or (B) an expense. Based on that choice, they will next be asked to enter a category for that expense/deposit. For example, if one chose option B, they could then type in food as the expense category.
Next, ask for the amount for that expense or deposit. If it was an expense, this amount will be subtracted from the current balance. If it was a deposit, it will be added.
Once the user enters everything, this information must be added to the text file. The program should also automatically determine the current date, as well as the current balance, and save all of this to the text file.
Note that to get and update the current balance, you will need to obtain the last item in the text file. This will probably be taken in as a String, so you must also parse it to convert to an integer. For example:
int number = Integer.ParseInt(someString);
Again, once we have all five variables (date, type, category, amount, and balance), they will be added into the text file in that order and separated by spaces. Finally, display back to the user that a log has been successfully added.
Option B: The program will read the given text file and print every log where the user has recorded an expense. Make sure to print all the information:
Date
Type (Expense or Deposit)
Category (such as Food, etc)
Amount
Balance
Option C:
The program will read the given text file and print the logs where the user has recorded a deposit. Make sure to display all the same information as described above in Option B.
Option D:
The program will first ask the user to enter the month he or she would like to look up. Next, read in the given text file and print all the logs where the month recorded is the same as that of the users input.
Option E:
This option is like Option D, but more specific. Again, ask the user to enter the month they would like to look up. Next, also ask them to select either Expenses or Deposits. Finally, ask the user for the deposit or expense category (food, salary, etc.). Once you have all this information, read the given text file and print all the logs that contain only the information that the user has set.
Option F:
Ask the user to enter a specific month and day he or she would like to look up. Next, read in the given text file and print all the logs where that month and day correspond to that which the user inputted.
Option G:
Like option F, ask the user to enter a specific month and day. Then, ask them to also enter whether it was an expense or deposit, as well as the category. Once you have all this information, read the given text file and print all the logs that contain only the information that the user has set.
Option H:
The program will ask the user what type of expense they would like to look up. Provide a menu listing the possible types of expenses they may choose from (such as food, entertainment, etc.). Once the user makes a choice, read the text file and print all the logs based on the inputted type.
Option I:
The program will ask the user what type of deposit they would like to look up. Provide a menu listing the possible types of deposits they may choose from (such as food, entertainment, etc.). Once the user makes a choice, read the text file and print all the logs based on the inputted type.
Option J:
This option will be to print all the logs from the text file.
Based on all this information, complete the code based on the skeleton provided.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started