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;
}
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.
Q10: A store provides 10 percent discount on
Q20: Insert the missing code in the following
Q35: Susie is skimming the assigned chapter looking
Q36: A class that represents a more specific
Q71: Identity crisis is comprised of both<br>A) dangers
Q75: What is the output of the code
Q80: Each object of a class has a
Q83: Which one of the following is the
Q86: Peer tutoring works well when the tutor
Q92: Joe and Don are working on a