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
sashaice [31]
3 years ago
11

Write a program that asks the user to enter the amount that he or she has budgeted for a month. A loop should then prompt the us

er 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:
Dominik [7]3 years ago
4 0

Answer:

import java.util.*;

public class Main {

public static void main(String[] args)

{

Scanner scan = new Scanner();

double budget=0, num=0, total=0;

System.out.println("Your budget for the month? ");

budget=scan.nextDouble();

System.out.println("enter all expense, and after that type -9999 to quit: ");

while(num != -9999)

{

total+=num;

num=scan.nextDouble();

}

if(total<=budget)

{

System.out.println("under budget by ");

System.out.println(budget-total);

}

else

{

System.out.println("over budget by ");

System.out.println(total-budget);

}

}

}

Explanation:

  • Take the budget as an input from user and store it to the budget variable.
  • Loop until user has entered all his expenses and keep on adding them to the total variable.
  • Check If the total is less than or equal to budget or otherwise, and then print the relevant message accordingly.
You might be interested in
I need help with question 3 I’ll give brainliest
Semmy [17]

Answer:

D) Engineering and Technology

Explanation:

Brent Designs or <em>Engineers </em>the equipment or<em> Technology </em>that is used to keep the plant safe.

7 0
3 years ago
Read 2 more answers
Some of the latest smartphones claim that a user can work with two apps simultaneously. This would be an example of a unit that
SIZIF [17.4K]

Answer:

MULTITASKING OS

Explanation:

MULTITASKING OPERATING SYSTEM is an operating system that enables and allow user of either a smartphone or computer to make use of more that one applications program at a time.

Example with MULTITASKING OPERATING SYSTEM smartphones user can easily browse the internet with two applications program like chrome and Firefox at a time or simultaneously

Therefore a user working with two apps simultaneously is an example of a unit that uses a MULTITASKING OS.

3 0
2 years ago
Which tab on the Ribbon contains the command to add a new, blank page to a publication?
aleksklad [387]

It's Insert. Insert > Page > Insert Page

4 0
3 years ago
Regular languages are closed under complement. True False
aivan3 [116]

Answer: True

Explanation:

A language is said to be closed under a operation here the complement is the operation then if upon application of that operation to any members of that language always yields a member of that language.

regular languages are closed under complement. A proof of the statement is

If a regular language 'L' is regular then there is a DFA X recognizing that regular language 'L'. to show that L' (compliment) is regular we need to have another DFA X' recognizing L'.

The initial state and transition function of both the DFAs are same except their accepting state. Then we can say that X' accepts L'.

So, we can say that regular languages are closed under complement.

4 0
3 years ago
What is the primary limitation of free versions of antivirus applications
ddd [48]

Answer:

Please look below for the answer

Explanation:

The primary limitation is that they don’t protect in real time. They also only perform quick scans which is not that efficient. They cannot scan the Windows directory. They only install on 64-bit operating systems

Hope I helped pls mark as brainliest

3 0
3 years ago
Other questions:
  • Create a public non-final class named Streamer. You should implement one class method: filterStrings. It should accept a single
    8·1 answer
  • The U.S. economy is a free enterprise system.<br><br> True<br> False<br><br> PLEASE DONT GUESS
    8·2 answers
  • Someone who is young, lacks funds, and really wants to gain technical skills while serving his or her nation should consider
    8·1 answer
  • What does the internet engineering task force (IEFT) do?
    5·1 answer
  • You are the administrator of a Windows network. When creating a new user account, you specify a security clearance level of top
    8·1 answer
  • What are the benefits of writing functions that use parameters and return? Try to list at least two.
    12·1 answer
  • The Brinley website will not let me search for questions anymore. It says “Search all you want in-app” and then covers the quest
    14·1 answer
  • Project stem test 3 answers
    14·1 answer
  • Many programmers think object-oriented programming is a superior approach to procedural programming. Others think it adds a leve
    7·1 answer
  • Presentations must have what to be efffective
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!