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
Firefox
any web browser can open a xps file
Optima battery because it is stronger than a factory battery
Answer:
a = float(input("Enter Side A: "))
b = float(input("Enter Side B: "))
c = float(input("Enter Side C: "))
d = float(input("Enter Side D: "))
e = float(input("Enter Side E: "))
area1 = 1.0* a * b
area2 = (a - c) * (d - e -b)
area3 = 0.5 * (a - c) * e
print ("Room Area: " + str(area1 + area2 + area3))
Explanation:
happy to help ^3^
Answer:
The correct answer to the following question will be Option D.
Explanation:
- A collection of nested title scopes are defined by the class hierarchy, even though a collection of nested methodologies as well as blocks see in an everything else.
- From the all, the lexical role characterizes the connection between certain scopes of names - if method d would be decided to declare somewhere within procedure c, therefore the namespace within the namespace of c would be nested.
- The more common classes in such a family hierarchy were near the peak of the tree as well as more specific classes are towards the edges.
Other choices have no connection with the given situation. So Option D seems to be the right response.