Ask Java Expert


Home >> Java

Introduction

In this assignment, you will implement a simple "Annual Expense Estimator" to tabulate your expense items. Expenses are an important component of a personal income statement. The most accurate way of coming up with your income statement is to keep a record of all incomes and expenses. If year-round record keeping is not possible, professional financial advisers often ask you to keep track of all income and expense records for 2-3 months, then the records can be used to estimate the annual value.

When no record is available at all, you can still estimate your annual expenses. One way to estimate is to list expense items according to their occurrence frequencies and the estimated amount each time the expense occurs. Then you can calculate the annual total of each item and the grand total of all expense items. If you store expense items (amount and frequency) in a 2-D array, you will use array notation to calculate the annual total of each expense item, e.g., expenses[i][0]*expenses[i][1].

Your program should produce formatted output similar to the following table. The ". . . " symbols here mean that additional items are omitted in the illustration. Your output should not have these ". . . ". That is, the expense items in the table are for illustration purposes; you should use the opportunity to produce a list of items as complete as possible to best reflect your expenses. Identify and list at least six items.

Item

Frequency

Times

Amount

Annual Total

Coffee

Daily

365

5.50

2,007.50

Grocery

Weekly

52

120.00

5,240.00

Phone

Monthly

12

75.00

900.00

Tuition

Semi-annually

2

6,500.00

13,000.00

...

...

...

...

 

Total

 

 

 

31,408.50

Implementation Requirement

1. There must be no less than 6 expense items that occur at various frequencies.

2. Use a 1-D array to store the item names.

3. Use a 2-D array to store expense item's amount and number of times it occurs in a year. The array should have just 2 columns. Use double data type for the values in the array.

4. This program must be implemented with a class that includes three methods:
- void main(String[] arg). It is the entry point of the program with expense item name, amount, and number of times occurred in a year hard coded and stored in array variables with appropriate types. It calls the outputInfo method to produce the desired output.
- String getLabel(int times). The method returns a meaningful frequency label based on the value of the times parameter. For example, if times is equal to 365, return
"Daily"; if it is equal to 12, return "Monthly"; and so on and so forth. You can use chained if ... else
- void outputInfo(String item, int times, double amount). It produces the desired
output using printf method. It needs to call the getLabel method with times as
parameter to obtain the frequency label

5. The main method of the program should follow the process described below:

Declare and initialize the 1-D array for item names

Declare and initialize the 2-D array for item amounts and frequencies Declare a variable for grand total and initialize it to 0
Begin for-loop

Add annual total to grand total

Output expense item 's name , amount , frequency as a string , and annual total
End for-loop Output grand total

In the loop, you need to call outputInfo method. For example, if the 1-D array is names and 2-D array is expenses and the frequency is in the second column, you can invoke the method like the following:
outputInfo(names[i],(int) expenses[i][1], expenses[i][0])


Create your write-up using a word processor (e.g., Word). Make sure you include the following parts:

- Title page. The title page should include the assignment information (e.g., Homework 1), your name, and a sentence summarizing what the program is about.

- Table of contents. List of all sections included in the submission. You do not need to have
page number for each section.

- All sections. The required sections of this exercise include:

- Overview. A brief description of the program: its function, input (the input is tuition information hard-coded in the program), and output.

- Design and Implementation. A description of the design choices and structure of the program: class, methods, variables, and other notable functions used (e.g., printf). Include a flowchart of the for-loop part of the main method. Also include a UML class diagram of the class using the notation adopted in this course.

- Testing. Include screenshots to show the function (e.g., output) of the program.
- Discussion. Include the following discussions as subsections:
∗ Difficulties encountered and how you solved them.
∗ Sources of help you used.
∗ What did you learn in terms of programming?
∗ What did you learn in terms of personal finance?
∗ Any other lessons learned from the assignment.
- Source code. Include source code as text, not images. Include comments in the source code to document your understanding of the code.

Java, Programming

  • Category:- Java
  • Reference No.:- M92374164
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Java

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As