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;
}
Cash Flow Calculator
A tool used to estimate the amount of cash generated and used by a business or individual in a specific time period.
Cash Flow
The total amount of money being transferred in and out of a business, especially as affecting liquidity.
Debt-to-Income Ratio
A financial metric that compares an individual's total monthly debt payments to their gross monthly income.
Annual Salary
The total amount of money an employee earns in one year before taxes and deductions.
Q1: An instance variable declaration consists of _.<br>A)
Q22: How many times will the output line
Q46: How many times does the following loop
Q49: Insert the missing code in the following
Q52: Write an if-statement condition that is true
Q54: A stub method is<br>A) A short method<br>B)
Q59: What is the output of the following
Q66: Girls have more equal distribution of gray
Q87: An integrated development environment (IDE) bundles tools
Q92: Consider the following code snippet:<br>ArrayList<Double> somedata =