1. What would the following statements, when used in a Java program, display
on the screen?
float salary;
salary = 5000.50f;
System.out.println (“My salary is”);
System.out.println(salary);
2. Write a statement or statements that can be used in a Java program to display
the following on the screen:
5
3
1
3. Write statements that can be used in a Java program to read your salary, as
entered on the keyboard, and display it on the screen.
4. Given a person’s year of joining in an organization and the current year,
the Year of Service Wizard can compute the number of years the person has
served. Write statements that can be used in a Java program to perform this
computation for the Year of Service Wizard.