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
Answer:
The answer to this question is given below in the explanation section.
Explanation:
The value stored by a variable can be changed after it is assigned(true).
The value of a variable can be changed after it is assigned, for example:
int a=10;
and we can change the value of variable a in letter program such as:
a=15;
Variables are a name for a spot in the computer's memory (true).
it is true, because the variables value stored in the computer's memory and we can access theses values by their name (variable name). so Variables are a name for a spot in the computer's memory.
Variable names can be words: such as temperature or height (true).
Yes, the variable name can be words such as height, width, temperature etc.
The value stored by a variable cannot be changed after it is assigned (false).
It is noted that the value stored by a variable can be changed after it is assigned. However, it is noted that is some programming language, you can't change the value of static variable.
Answer:
Recording and publishing training videos for new employees
Explanation:
Multimedia specialists design and create IT-based multimedia products such as websites, DVDs, and computer games that combine text with sounds, pictures, graphics, video-clips, virtual reality and digital animation
Answer: XML files that contain the code that to be inserted, elements that control its behaviour and metadata such as the author's name.
Explanation:
Answer:
C. sqrt(Math)
Explanation:
All but one of options A to E are is not a static method.
Only option C is a static method. The sqrt() is a static method of Math, that can always be used as Math.sqrt() is used;
The Math class defines all of its methods to be static. Invoking Math methods is done by using Math as a method rather than a variable of type Math; this means that sqrt(Math) doesn't rely on instance variables and don't need to be overridden, unlike others.
Lastly, sqrt(Math) is a static method because unlike other options, it is an utility method, and it is relevant to computations on primitive data types.
The purpose of the static method is in large part to offer a standard library of functions, and it doesn't need to be applied directly to an object.