Java Student Project         

TimeWorked
Ability Level: Beginner  
Estimated Time: 40 minutes
Objectives:
  • To learn how to use variables and constants.
  • To learn about the int, floating-point, and char data types.
  • To learn how to write arithmetic statements.
  • To learn about the modulus operator. 
Materials & Resources:
  • Java Software
  • Textbook
Overview: Write a program that declares a minutes variable which will be the identifier for the minutes worked on a job. Assign a value ( 256 ) to this variable. Use the modulus operator to calculate the the hours and minutes. Display the value in hours and minutes such as 4 hours and 29 minutes. Display explanatory text with the values.
Instructions:


Use the following template to help you get started:
public class timeWorked
 { 
   public static void main(String args[]) 
    { 
       System.out.println("Program Time Worked");
       .....[code here]
     }
   }

Hints: Some important points to keep in mind in doing this project:
  1. Variable names usually begin with lowercase letters to distinguish variable names from class names.
  2. You can declare variables at any point within a method prior to their first use. It is common practice to declare variables first and place method calls second.
  3. You can use modulus ( % ) only with integers. All other  operators can be used with floating-point data.
  4. Modulus division returns the remainder of the integer division problem.
  5. An operand is simply any value used in an arithmetic or logical operation.