Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This interactive program focuses on if/else statements, Scanner, and returning values. Turn in a file named Budgeter.java. To use a Scanner for console input, you

This interactive program focuses on if/else statements, Scanner, and returning values. Turn in a file named Budgeter.java. To use a Scanner for console input, you must import java.util.*; in your code.

This program prompts a person for income and expense amounts, then calculates their net monthly income. Below are two example logs of execution from the program. This programs behavior is dependent on the user input (user input is bold and underlined below to make it stand out). Your output should match our examples exactly when given the same input. (Be mindful of spacing, such as after input prompts and between output sections.) Look at the other example logs on the Canvas site to get more examples of the program's behavior.

The program begins with an introductory message that briefly explains the program. The program prompts the user for the number of income categories, then reads in that many income amounts. Next, the program asks whether the user would like to enter monthly or daily expenses. (The user enters 1 for monthly and 2 for daily.) The program will then read in a number of expense categories and an amount for each category, similar to how income was read.

The program should then print out the total amount of income and expenses for the month, as well as the average amount of each per day. You may assume a month has exactly 31 days, though your program should be able to be easily modified to change this assumption (see below).

After printing the total income and expenses, the program should print out whether the user spent or earned more money for the given month and by how much. If income and expenses were exactly equal, the user is considered to have earned $0 more than they spent (as opposed to spending $0 more than they earned).

Finally, the program should print out which category the user falls into based on their net income for the month (rounded to two decimal places). The users net income is the result of subtracting their expenses from their income. The four categories are defined as follows:

More than +$250: "big saver"

More than $0 but not more than +$250: "saver"

More than -$250 but not more than $0: "spender"

-$250 or less: "big spender"

After printing the users category, print a custom message of your choice about their spending habits. This message should be different for each range shown above. It should be at least 1 line of any non-offensive text you like.

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

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

Know how to approach on-the-job training

Answered: 1 week ago

Question

LO2 Explain the major laws governing employee compensation.

Answered: 1 week ago