Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hey there, I've already written a program in Java for this project and I need a little help with it. (I need a new class

Hey there, I've already written a program in Java for this project and I need a little help with it. (I need a new class that prints out the user's info and expenses, income, etc. I need a class that connects them all together basically) Heres the explanation for the program and the classes, UML.

Problem Description

Our proposed application aims to help individuals manage their personal finances. The application will be called "Money Manager" and will allow users to track their income, expenses. And manage their money better.

Application Description Money Manager application:

Helps the users track their income and expenses.

The user will be able to set a reset point in the month where all expenses will be wiped and reset automatically.

Main currency would be the dollar.

Classes and Relations

We will use 4 classes: user class, income class, expense class and test class.

The user class:

This class will hold information such as the user's name, income, and expenses. It will have private attributes such as "name", "income", and "expenses" and corresponding set/get methods. It will also have at least two constructors, one of them taking all of the class's data members as arguments.

The income class:

This class will hold information about the user's income, including the source of the income and the amount. It will have private attributes such as "source" and "amount" and corresponding set/get methods. It will also have a constructor that takes these attributes as arguments.

The expense class:

This class will hold information about the user's expenses, including the category of the expense and the amount. It will have private attributes such as "category" and "amount" and corresponding set/get methods. It will also have a constructor that takes these attributes as arguments.

The test class:

This class will be responsible for creating objects of the User, Income, and Expense classes and demonstrating the relationship between them. It will also handle input validation and reading and writing the objects to a file.

The classes will interact with each other as follows:

The User class will have an ArrayList of Income and Expense objects.

The Test class will handle user input to create objects of the User, Income, and Expense classes and add them to the appropriate ArrayList.

The Test class will also handle reading and writing the objects to a file.

The Test class will display the details of the objects to the user.

Diagram (UML):

User

+name: String

+income: ArrayList

+expenses: ArrayList

+getName(): String

+setName(name: String): void

+getIncome(): ArrayList

+setIncome(income: ArrayList): void

+getExpenses(): ArrayList

+setExpenses(expenses: ArrayList): void

+User(name: String, income: ArrayList, expenses: ArrayList)

Income

+source: String

+amount: Double

+getSource(): String

+setSource(source: String): void

+getAmount(): Double

+setAmount(amount: Double): void

+Income(source: String, amount: Double)

Expense

+category: String

+amount: Double

+getCategory(): String

+setCategory(category: String): void

+getAmount(): Double

+setAmount(amount: Double): void

+Expense(category: String, amount: Double)

Test

+users: ArrayList

+createUser(): void

+createIncome(): void

+createExpense(): void

+addToFile(): void

+readFromFile(): void

+displayDetails(): void Make the new class as well as the UML for it. Thanks!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions

Question

Calculate the solubility of Ag2CO3. [Ksp= 6.3 x 10 -23]

Answered: 1 week ago