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]
4 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]4 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
Variable costs are __________.<br><br> A. decreasing<br> B. increasing<br> C. static
lubasha [3.4K]
The answer is A. Decreasing
5 0
3 years ago
Which four of the following qualify as fair use?
lora16 [44]

Answer:

1 using the quote and citing it

Explanation:

6 0
3 years ago
Read 2 more answers
Givе thе dеclaration for a function calculatеAvеragе() that takеs an array of doublеs and an int namеd count
Kisachek [45]

Answer:

void calculatеAvеragе(double array1[],int count);//function declaration

Explanation:

Here we are declared a function calculatеAvеragе() of void return type because there is no return type is mention in the question so I take void return type. The calculatеAvеragе() function takes two parameters one is an array of type double and other is a variable count of int types.

To declared any function we used following syntax

return_type functionname(parameter 1,parameter 2 .....parameter n)

So void calculatеAvеragе(double array1[],int count);

4 0
3 years ago
SQL a. has become the de facto standard database language b. can be used to define database systems c. both a. and b. d. none of
ElenaW [278]

Answer:

a.)has become the de facto standard database language

Explanation:

SQL known as Structure Query Language can be described as domain specific language that is Been used in execution of tasks son database. Those task could be updating of data.

Database admistraion.

Microsoft SQL server is one of the example of database system that uses SQL.

It should be noted that SQL has become the de facto standard database language

6 0
3 years ago
Who coined the term web log for an online journal
astra-53 [7]
Jorn Barger did this
6 0
4 years ago
Other questions:
  • Select the correct answer.
    11·1 answer
  • Which asynchronous electronic community is also known as a forum?
    9·2 answers
  • The process of finding the largest and smallest numbers is used frequently in computer applications. Write a C++ program that us
    15·1 answer
  • Which section from the article BEST explains why humans could benefit from studying a particular type of extremophile?​
    6·1 answer
  • Choose the correct answer base on the Components of Computer System
    14·1 answer
  • A flat panel detector’s detector element size determines what?
    10·1 answer
  • The function of the file server is to : 1. store data and software programs that can be used by client computers on the network.
    12·1 answer
  • The duties of a database administrator include determining which people have access to what kinds of data in the database; these
    13·2 answers
  • Nhiệt độ chiết rót của máy chiết rót có van trượt là bao nhiêu
    6·1 answer
  • Convert (0.255)¹⁰ into binary<br>​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!