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
goldfiish [28.3K]
3 years ago
14

16. Budget Analysis Write a program that asks the user to enter the amount that he or she has budgeted for a month. A loop shoul

d then prompt the user 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:
strojnjashka [21]3 years ago
6 0

Answer:

import java.util.Scanner;

public class num8 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter month's budget");

       double monthBudget = in.nextDouble();

       double totalExpenses = 0.0;

       double n;

       do{

           System.out.println("Enter expenses Enter zero to stop");

           n = in.nextDouble();

           totalExpenses += n;

       }while(n>0);

       System.out.println("Total expenses is "+totalExpenses);

System.out.println("The amount over your budget is "+ Math.abs(monthBudget-totalExpenses));

   }

}

Explanation:

  • Using Java programming language
  • Prompt user for month's budget
  • Use Scanner class to receive and store the amount entered in a variable
  • Use a do while loop to continuously request user to enter amount of expenses
  • Use a variable totalExpenses to add up all the expenses inside the do while loop
  • Terminate the loop when user enters 0 as amount.
  • Subtract totalExpenses from monthBudget and display the difference as the amount over the budget

You might be interested in
What does "Forward" in emails do?​
tatuchka [14]
Basically just want to make your your email is easy
4 0
3 years ago
A programmer has an idea to use just one language for the content, structure, and style of web pages. What might be a problem wi
Juliette [100K]
Doesn’t give the programmer a lot of freedom to be creative. Using only one language on the web limits the amount features the programmer could create.

For example, just only using HTML limits the web page’s features to use scripts like Javascripts.
8 0
2 years ago
4-One possible performance multiplication enhancement is to do a shift and add instead of an actual multiplication. Since 9 * 6,
pychu [463]

Answer:

Check the explanation

Explanation:

The above question can be sovled in the below step by step way:

15 can be written as 16-1 = 24 -1

Therefore, 15 *13 = (24 -1)*13

= 13*24 - 13

Now, when we left shift a number we multiply it by 2k .Where k is no of times we left shifted it.

Therefore, 13*24 = shift 13 to left 4 times

15 * 13 = shift 13 to left 4 times and subtract 13 from it.

3 0
3 years ago
"You are on a service call to fix a customer’s printer when she asks you to install a software package. The software is on a per
pickupchik [31]

Answer:

Ask her to get a genuine software

Explanation:

if i will install, it can cause the following problems:

1. Prated software makes your system Vulnerable to the security attacks because the activities of the software are not monitored by any organization and no one is responsible for anything bad happened to your system.

2. It may stop working anytime because there would not be maintenance patches available for it so that it can work properly.

3. It cannot be updated and may cause problems in core functionalities of it.

4.Serious legal actions can be taken against anyone using them because  economy has drastic decrease due ti use of it.

7 0
3 years ago
Which of the following cannot be used in MS Office.<br> Joystick<br> Scanner<br> Light Pen<br> Mouse
ValentinkaMS [17]

Answer:

A.

Explanation:

A Joystick is a control device that is connected to the computer to play games. A joystick is similar in structure to a control stick used by pilots in airplanes and got its name from the same. A joystick contains a stick, base, extra buttons, auto switch fire, trigger, throttle, POV hat, and a suction cup. A joystick also serves the purpose of assistive technology.

The device which can not be used in MS Office is a joystick. Therefore, option A is correct.

6 0
2 years ago
Other questions:
  • A network engineer arrives at work and discovers that many users are having problems when attempting to connect to the company n
    9·2 answers
  • What is binary number
    11·1 answer
  • Which of the selection below does not represent a workable IP address?
    9·1 answer
  • (1) Output a menu of automotive services and the corresponding cost of each service. (2 pts)Ex:Davy's auto shop servicesOil chan
    9·1 answer
  • The term "exception propagation" means:
    5·1 answer
  • What is a Slide Master? A. the placeholder used to insert objects B. the sequence of slides in a presentation C. the default des
    14·1 answer
  • Why does this website have so many copies of plagiarism?
    5·1 answer
  • HOW TO DISCONNECT A MONITOR FROM A SYSTEM UNIT
    6·1 answer
  • If you try to add a new item to a full stack the resulting condition is called a(n)?
    13·1 answer
  • Distributed databases and data warehouses would be considered which data model type?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!