2 Replies - 1293 Views - Last Post: 02 October 2012 - 09:49 AM

#1 Xcody  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 24
  • Joined: 13-August 10

My first java program. HEHE. :))

Posted 02 October 2012 - 09:46 AM

package assignment1;
import java.util.*;
import java.io.*;

public class Assignment1 {
    
    public static void main(String[] args) throws Exception{
        DataInputStream name1 = new DataInputStream(System.in);
        Scanner input = new Scanner(System.in);
        int salary;
        int tax;
        int total;
        double tax1 = .20; 
        System.out.print("Enter Employee's Name: ");
        String name=name1.readLine();
        System.out.print("Enter Employee's Hours of Work: ");
        int i=input.nextInt();
        System.out.print("Enter Employee's Rate: ");
        int d=input.nextInt();
        
        salary = i * d;
        tax = (int) (salary * tax1);
        total = salary - tax;
        System.out.println("***Salary of Employee***");
        System.out.println("Employee's Name: " +name);
        System.out.println("Employee's Hours of Work: " +i);
        System.out.println("Employee's Rate: " +d);
        System.out.println("Employee's Tax: " +tax);
        System.out.println("Employee's Gross Salary: " +salary);     
        System.out.println("Employee's Total Salary: " +total);      
    }
}


Just nothing. I just want to share. :) HEHE.

This post has been edited by jon.kiparsky: 02 October 2012 - 09:48 AM
Reason for edit:: use the code tags, please


Is This A Good Question/Topic? 0
  • +

Replies To: My first java program. HEHE. :))

#2 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7874
  • View blog
  • Posts: 13,355
  • Joined: 19-March 11

Re: My first java program. HEHE. :))

Posted 02 October 2012 - 09:48 AM

Congratulations. Next time, use the code tags so we can all admire your work.
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5363
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: My first java program. HEHE. :))

Posted 02 October 2012 - 09:49 AM

** topic moved to share your project **
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1