Define a class constant for number of days in month

Assignment Help Basic Computer Science
Reference no: EM132263985

Budgeter.java

This interactive program focuses on if/else statements, Scanner, and returning values. 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 program's 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 user's 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 user's 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.

Sample run. Things in bold and underlined are user input:

This program asks for your monthly income and

expenses, then tells you your net monthly income.

How many categories of income? 3

Next income amount? $1000

Next income amount? $205.25

Next income amount? $175.50

Enter 1) monthly or 2) daily expenses? 1

How many monthly categories of expense? 4

Next expense amount? $850

Next expense amount? $49.95

Next expense amount? $75

Next expense amount? $120.67

Total income = $1380.75 ($44.54/day)

Total expenses = $1095.62 ($35.34/day)

You earned $285.13 more than you spent this month.

You're a big saver.

<<your custom message here>

Another sample run. Things in bold and underlined are user input:

This program asks for your monthly income and

expenses, then tells you your net monthly income.

How many categories of income? 2

Next income amount? $800

Next income amount? $200.25

Enter 1) monthly or 2) daily expenses? 2

How many daily categories of expense? 1

Next expense amount? $45.33

Total income = $1000.25 ($32.27/day)

Total expenses = $1405.23 ($45.33/day)

You spent $404.98 more than you earned this month.

You're a big spender.

<<your custom message here>

This program processes user input using a Scanner. All monetary inputs will be real numbers; all other input will be integers. You may assume the user always enters valid input. When prompted for a value, the user will enter a value of the correct type. The user will enter a number of income and expense categories ≥ 1 and will only ever enter 1 or 2 when asked how to enter expenses. The amount for each category of income and expense will be a non-negative number.

You are required to define a class constant for the number of days in a month. You should refer to this constant throughout your program so that the value can be changed and your program will continue to function correctly.

Reference no: EM132263985

Questions Cloud

Discuss erp systems in the focus of systems analysis : Discuss ERP Systems in the focus of Systems Analysis &Design , its application - specific, analysis, modelling , design
What are the differences between what cyber command : QUESTION 1: What are the differences between what Cyber Command and the NSA can do in cyber warfare?
Describe what threats there might be and how those could be : Assume you have threat modelled an Application Programming Interface (API). Describe what threats there might be and how those could be mitigated.
Describe the business processes in deutsche bank : Describe the business processes / functions in Deutsche Bank that are under consideration for utilizing Blockchain technology.
Define a class constant for number of days in month : You should refer to this constant throughout your program so that the value can be changed and your program will continue to function correctly.
Discuss about input parameters and project cost formula : Create a table with different topics listed as column headings that distinguish these applications from each other.
How events might have unfolded differently : Could stronger corporate governance and greater business integrity have made any difference? The answer to counterfactuals is always uncertain.
What are there primary network attraction strategies : What are there primary Network Attraction Strategies? Identify three network attraction strategies that each of the companys appear to be employing?
Updates from a wsus server at the main office : A WSUS server is set up at a branch office that gets its updates from a WSUS server at the main office. The option to approve updates is not available

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd