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
WILL GIVE BRAINLYIEST 3pts) Make a prediction about which material will be the best insulator and conductor of heat. Materials:
sesenic [268]

Answer:

a. I think the <u>Aluminum</u> will conduct heat better.

b. I think the <u>Fiberglass</u> will insulate heat better.

Fiberglass is used to insulate most everyday items, so I can be sure that fiberglass can be the best insulator, as for aluminum it conducts heat like you wouldn't believe.

Note: Your answer doesn't have to be right, they just want you to make a prediction about your answer, that means it's alright to guess, also know I didn't guess I am just telling you that you didn't have to ask this question. <3

6 0
3 years ago
In what respects does a UML state diagram differ from a state transition diagram?
musickatia [10]

Answer: The difference between the UML state diagram and state transition diagram are as follow:-

  • State-transition diagrams display the states of the object where the change takes place whereas the UML(Unified modeling language) state diagrams are representation of parts of system at certain time instance.
  • State-transition diagram requires the condition to be accomplished before the transition happens whereas the dynamic behavior of the states are expressed by transitions in UML state diagrams.

5 0
3 years ago
Do you guys know the addition and subtraction of binary numbersi need help in that
Gala2k [10]

Answer:

The process of adding binary numbers is the same as the process adding decimal numbers which are the normal base 10 numbers with the difference being that in decimal numbers there are digits 1 to 9 and in binary numbers, there are only digits 1 and 0

So when we add binary numbers, we havr;

0 + 0 = 0

1 + 0 = 1

0 + 1 = 1

1 + 1 = 10

Why 1 + 1 = 10 is because, there are no 2s in binary number system, just like when we get from 0 to 9 in a decimal system we start again at 10

For binary subtraction, we have the following;

0 - 0 = 0

1 - 0 = 1

1  - 1 = 0

10 - 1 = 1 (from 1 + 1 = 10)

For example 1100₂ - 1010₂ = 0010₂

As shown below

Borrow 1

,     ↓

 1, 1 ¹0 0

<u>  1, 0 1 0</u>

, 0  0  1  0

The addition and subtraction of the binary number system are similar to that of the decimal number system. The only difference is that the decimal number system consists the digit from 0-9 and their base is 10 whereas the binary number system consists only two digits (0 and 1) which make their operation easier

Explanation:

4 0
4 years ago
What are video games and what have they meant for society?
Paraphin [41]

video games are a source of entertainment for people especially children.

it helps relieve stress for adults or grown ups.

society sees video games as a negative impact on children and that it wastes their time.

8 0
3 years ago
Read 2 more answers
Which company invented the Six Sigma process?
horsena [70]

Answer:

Motorola

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Is a software program that allows users to access the world wide web
    10·1 answer
  • Do we have to use intersection?
    6·1 answer
  • Match each of the following terms to its function:_________
    13·1 answer
  • What does Adsl stand for?
    7·2 answers
  • What are the benefits of organizing your thoughts before you begin your speech
    14·1 answer
  • Annie is a nutritionist. She is conducting seminars about following a healthy diet in various offices. Annie adds a picture of f
    14·2 answers
  • Access Control can be defined as putting controls (or countermeasures) in place to help achieve information security goals. Whic
    13·2 answers
  • What was the technology that defined each of the four generations of computers?
    12·1 answer
  • A software update is also referred to as what?
    15·2 answers
  • Koi jinda hei kya hello​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!