1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
goldfiish [28.3K]
3 years ago
14

16. Budget Analysis Write a program that asks the user to enter the amount that he or she has budgeted for a month. A loop shoul

d then prompt the user to enter each of his or her expenses for the month, and keep a running total. When the loop finishes, the program should display the amount that the user is over or under budget.
Computers and Technology
1 answer:
strojnjashka [21]3 years ago
6 0

Answer:

import java.util.Scanner;

public class num8 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter month's budget");

       double monthBudget = in.nextDouble();

       double totalExpenses = 0.0;

       double n;

       do{

           System.out.println("Enter expenses Enter zero to stop");

           n = in.nextDouble();

           totalExpenses += n;

       }while(n>0);

       System.out.println("Total expenses is "+totalExpenses);

System.out.println("The amount over your budget is "+ Math.abs(monthBudget-totalExpenses));

   }

}

Explanation:

  • Using Java programming language
  • Prompt user for month's budget
  • Use Scanner class to receive and store the amount entered in a variable
  • Use a do while loop to continuously request user to enter amount of expenses
  • Use a variable totalExpenses to add up all the expenses inside the do while loop
  • Terminate the loop when user enters 0 as amount.
  • Subtract totalExpenses from monthBudget and display the difference as the amount over the budget

You might be interested in
RAM is usually a. secondary storage b. a static type of memory, used for permanent storage c. a volatile type of memory, used fo
PolarNik [594]

Answer:

The correct answer to the following question will be Option C (Volatile type of memory).

Explanation:

Random Access Memory, a variety of computer's memory which could be retrieved accidentally i.e., some memory can be obtained without any of the previous bytes being touched.

  • Volatile memory is a type of a storage in computer that only retains its information or data while powering the appliance.
  • Almost all of the RAM used in Pc's for the primary storage is unstable storage.

So, Option C is the right answer.

8 0
3 years ago
How people select, interpret, remember, and use information to make judgments and decisions is called __________.
Svetradugi [14.3K]

Answer: Social Cognition

Explanation: hope this helps

6 0
3 years ago
An abstraction is a simplified representation of something that is more complex. Decimal numbers were a useful abstraction in th
Blababa [14]

What was the content of the lesson? It is hard to answer a question we need context on.

6 0
3 years ago
Many computer users, especially beginners, find ________ interfaces difficult to use.
lesya [120]

Many computer users, especially beginners, find Command Line Interfaces difficult to use.

The word Command Line will come in the blank. Other names for Command line interface (CLI) are console user interface and character user interface (CUI). It is a user interface to a computers operating system. 

4 0
3 years ago
Algorithm to print the first 10 odd numbers​
77julia77 [94]

Answer:

I have the code written in c++ but the logic will be the same you just have to change the syntax ( if you're writing different language)

Explanation:

please mark brainliest

4 0
2 years ago
Other questions:
  • A(n) ________ signal is a discrete, binary waveform that transmits data coded into two discrete states such as 1-bits and 0-bits
    12·1 answer
  • Which are malicious codes? <br><br> JavaScript <br> Key loggers <br> Scrum <br> Spyware <br> Worms
    12·1 answer
  • Which of the following are reasons why it is important to properly recycle electronic equipment? Select all that apply.
    14·2 answers
  • How can websites illustrate cooperation and kindness?
    8·2 answers
  • Is the jane austen pride and prejudie a primary source
    6·1 answer
  • Iciples UI
    12·1 answer
  • Ns.office.com/Pages/ResponsePage.aspx?id=bd8
    9·2 answers
  • Evaluate if the following function is a good candidate to be placed in a library. Why or why not?
    10·2 answers
  • is a security design principle to direct the selection of control layers for an organization's computing enclave to ensure its r
    6·1 answer
  • A common hardware component found in electronic devices including desktop computers, laptops, tablets and smartphones. The amoun
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!