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
Which step should Rupa take?
PilotLPTM [1.2K]

Complete Question:

Rupa would like to quickly insert a table into her document without having to worry about formatting the data in the table. Which step should Rupa take?

Group of answer choices.

A. Insert tab, Tables group, Draw Table option

B. Insert tab, Tables group, Insert Table option

C. Insert tab, Tables group, Quick Tables option

D. none of the above

Answer:

C. Insert tab, Tables group, Quick Tables option

Explanation:

Microsoft Word refers to a word processing software application or program developed by Microsoft Inc. to enable its users to type, format and save text-based documents.

In Microsoft Word 2019, the users are availed with the ability to edit the word document in the following view type;

I. View Mode.

II. Print Mode.

III. Drift Layout.

Quick tables refers to the pre-formatted or pre-created stored in building blocks galleries that are easily accessible to the end users at any time.

In this scenario, Rupa would like to quickly insert a table into her document without having to worry about formatting the data in the table. The steps which Rupa should take are click on Insert tab, Tables group and then select the Quick Tables option.

6 0
2 years ago
Data in the form of digits is called
Flauer [41]
Numeric data because it consist of numbers
5 0
2 years ago
What information is displayed in the message header of a received message? Check all that apply.
Aleks04 [339]

Answer:

the subject of the message

the sender's name

the recipient's name

the date and time when the message was received

Explanation:

Various information is displayed in the header of the message of a received message. And they are the subject of the message, which briefs what is there inside the message. And it mentions the sender's name as well as the recipient's name, and finally, the date and the time as well are stated that explains exactly when the message was being received. And all this information is shown in the header of the message.

3 0
3 years ago
What is the transfer rate of DDR memory?<br> A. 16 bit <br> B. 32 bit <br> C. 64 bit <br> D. 128 bit
marshall27 [118]
C. 64 bit is the answer
3 0
3 years ago
Read 2 more answers
Which of the following detects unauthorized user activities, attacks, and network compromises, alerts of the detected attacks, a
Anit [1.1K]

The answer is IPS (Intrusion Prevention Systems)

The Intrusion Prevention Systems and Intrusion Detection Systems (IDS) are two security technologies that secure networks and are very similar in how they work. The IDS detects unauthorized user activities, attacks, and network compromises, and also alerts. The IPS, on the other hand, as mentioned, is very similar to the IDS, except that in addition to detecting and alerting, it can also takes action to prevent breaches.


3 0
3 years ago
Other questions:
  • Attention merchants define
    5·1 answer
  • What is a “spoof” of an ad ?
    8·2 answers
  • What are the core scripting and coding technolies used to build ai platforms?
    14·1 answer
  • &gt;&gt;&gt; import math &gt;&gt;&gt; print(math.Pi) 3.141592653589793 &gt;&gt;&gt; def print_volume(): print ("What is the radi
    12·1 answer
  • What does intergrated organization mean
    15·1 answer
  • Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicatin
    10·1 answer
  • All of these valid ways to earn money in microworkers except
    8·1 answer
  • How should tools be stored <br>​
    13·1 answer
  • Ask the user to input a number less than 100. Print all the numbers from that number to 100.
    6·2 answers
  • Why is it a good idea not to change the subject line when replying to a message?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!