Examlex
What will be the final output of the following code snippet when a user enters input values in the order 10, 20, 30, 40, 50, and -1? public static void main(String[] args)
{
Double sum = 0;
Int count = 0;
Double salary = 0;
Double average = 0;
Scanner reader = new Scanner(System.in) ;
System.out.println("Enter salaries (-1 to stop) : ") ;
While (salary != -1)
{
Salary = reader.nextInt() ;
If (salary != -1)
{
Sum = sum + salary;
Count++;
}
}
If (count > 0)
{
Average = sum / count;
System.out.println("The Average Salary: " + average) ;
}
Else
{
System.out.println ("No data!") ;
}
Return 0;
}
Liabilities
Liabilities represent obligations or debts that a company owes to external parties, which must be settled through the transfer of assets or services.
Assets
Economic resources owned by a business or individual, expected to bring future benefits.
Net Income
The total profit or loss of a business after all expenses, taxes, and costs have been subtracted from total revenue.
Net Loss
A situation where total expenses exceed total revenues, indicating a negative profit.
Q6: Assuming that a user enters 25 as
Q16: Suppose you wish to use an array
Q23: You wish to implement a callback method
Q26: Complete the following code snippet with the
Q27: What is the output of the following
Q50: To ensure that an instance variable can
Q73: Which of the following is an example
Q87: What is the output of the following
Q105: Which of the following loops will print
Q123: Which loop does not check a condition