Examlex

Solved

What Will Be the Final Output of the Following Code

question 64

Multiple Choice

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;
}

Recognize the classification and treatment of cash and cash equivalents in financial reporting.
Identify the objectives and components of physical controls to safeguard assets.
Comprehend the periodicity and independence requirement of internal reviews for reinforcing internal controls.
Acknowledge the limitations and the cost-benefit principle underlying internal controls.

Definitions:

Investing Activities

Financial transactions related to the acquisition or disposal of long-term assets and investments.

Net Cash Provided

The total amount of cash generated by an organization's operational activities over a specific period, typically reported on the cash flow statement.

Transactions

Economic interactions or exchanges between parties that involve the transfer of goods, services, or funds.

Investing Activities

Transactions involving the purchase and sale of long-term assets and other investments not related to the day-to-day operations.

Related Questions