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
Dynamic addressing: __________.
Anarel [89]

Explanation:

jwjajahabauiqjqjwjajjwwjnwaj

6 0
3 years ago
Read 2 more answers
A(n) _____ is a computerized system by which subscribers are able to communicate to all other subscribers by sending a transmiss
ololo11 [35]

Answer: Listerv

Explanation:

5 0
3 years ago
Suppose that a database modification results in the execution of a trigger but that trigger generates another modification that
zhenek [66]

Answer:

The database can detect only system-defined events.

Explanation:

A trigger is like a stored procedure that Oracle Database invokes automatically whenever a specified event occurs.trigger is like a stored procedure that Oracle Database invokes automatically whenever a specified event occurs.

Both triggers and constraints can constrain data input, but they differ significantly.

A constraint applies to both existing and new data. For example, if a database column has a NOT NULL constraint, then its existing data is NOT NULL and no DML statement can violate the NOT NULL constraint.

A trigger applies only to new data. For example, a trigger can prevent a DML statement from inserting a NULL value into a database column, but the column might contain NULL values that were inserted into the column before the trigger was defined or while the trigger was disabled

5 0
4 years ago
Hello, please help write code in C++. Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go nort
krok68 [10]

Answer:

Please Find attached  c++ code file.

Explanation:

  1. Ask User to enter highway number.
  2. Check if highway is primary or auxiliary.
  3. Check if highway number is even / odd.
  4. Find Primary high number for an auxiliary highway

Check if highway is primary or auxiliary.

Use if condition to check if the entered number is in between 0 and 99.If it's true than the highway is primary otherwise it's an auxiliary highway.

Check if highway number is even / odd.

To check if a number is even or odd we use simple modulo formula. In mathematics modulo returns the reminder of a division operation on two numbers.If modulo of a number and 2 is equal to zero than that number is an even number other wise its an odd number.

(Any number ) mod 2 = 0

Find Primary high number for an auxiliary highway

As mentioned in the question last two digits of highway number is the number of primary high.

To Find last two digits of number apply modulo operation on highway number and 100. it will provide last two digits of number specifying our primary highway.

Download cpp
3 0
4 years ago
In access, field names cannot contain digits. true or false.
Sedaia [141]
The answer is false.
8 0
3 years ago
Other questions:
  • Presentation software allows business professionals to _____.
    14·2 answers
  • To transfer data packets between two or more networks, a ________ is used.
    11·1 answer
  • A must decode this code. I guess is not a Cesar. The last line is a email adress.
    15·1 answer
  • Technician A says that high pressure in recycled refrigerant is only caused by air contamination. Technician B says that recycle
    15·1 answer
  • Which of the following provides services to hosts on its network?
    9·1 answer
  • To obtain the desired speedup, make sure your new function recursively calls itself no more than once in the body of the method.
    8·1 answer
  • 20 points!!
    7·1 answer
  • The base position for your fingers to be placed on a keyboard is called<br> 2 point
    15·2 answers
  • In disc brakes, pads are forced against the of a brake disc​
    14·1 answer
  • While some audio recording programs are expensive, there are more user friendly,
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!