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 is the most popular language used in game programming?
ANEK [815]

Answer:

B C++

Explanation:

The two most common languages for game designers to learn are C++ and Java, although other languages are popular (such as C# for Unity). Another type of programming you may hear referred to is scripting, but that essentially comes down to a type of systems programming.

4 0
3 years ago
Read 2 more answers
Which online note-taking device allows students to clip a page from a website and reuse it later?
Marrrta [24]

Answer:

The answer is A.) web clipping tools.

Explanation:

Cuz like yeah

5 0
2 years ago
Read 2 more answers
Joshua takes ownership of all his tasks. Which quality is he demonstrating?
Oxana [17]
Were these the choices?
A. Honesty B. Responsibility C. Approachability D. Confidence E. Resourcefulness 

If so, it would be Letter B - responsibility. He's taking responsibility for the tasks. He's taking the initiative to do the tasks rather than waiting passively for someone to do it.
8 0
3 years ago
Read 2 more answers
Is this code object-oriented, or is it procedural? what clues in the code itself did you use to determine what kind of code it i
Katen [24]

An Object-Oriented code or coding refers to a technique of programming that utilizes the identification of classes of objects that are closely tied to the functions with which they are related.

<h3>What is a Procedural Oriented Code?</h3>

This refers to a kind of programming language that utilizes a step-by-step method so as to break down a task into a set or a collection of factors or variables and routines or sub-routines using a set of instructions that are sequential.

Objects in programming refer to a type of abstract data that has a state and behavior. It is a specific instance of a class.

A class in programming is a templated definition of the techniques and variables of a certain type of object.

<h3>What are some of the principles and structures of coding?</h3>

There are 10 principles of coding. Some of them are:

  1. Keep it simple
  2. Separate concerns
  3. Document your Code etc.

Some of these principles can be used in normal day-to-day activity and even in business. item 1 for instance can be used during communication.  Effective communication is more effective when it is kept very simple.

It is to be noted that the code referenced in the question is unavailable hence the general answer.

Learn more about Object-Oriented Code at:
brainly.com/question/4560494

3 0
2 years ago
The graph shows that sixty-eight percent of students think cyberbullying is a problem. One hundred human stick figures are shown
kari74 [83]

Answer:

C.

More students are affected by cyberbullying than not affected.

Explanation:

I got it correct on Edgenuity 2020.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Spoken word and written word are different because what
    9·1 answer
  • 1 Point
    14·1 answer
  • What keyboard functions lets you delete words
    15·2 answers
  • What is the difference between an activity inventory and an object inventory?
    8·1 answer
  • Question #5
    14·1 answer
  • Does anyone have discord
    14·2 answers
  • I am booooooored any one want to join
    5·2 answers
  • You can resize a row in a table by dragging the ____.
    13·1 answer
  • How does the use of blocking affect the external sorting algorithm, and how does it change the cost formula
    5·1 answer
  • Consider the following code using the posix pthreads api:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!