CSC113_Lab5_Solution - KSU / CCIS CSC113 Lab 5 Inheritance...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
KSU / CCIS CSC113 Lab 5 Inheritance SOLUTION Date: 6 10/11/2010 Lab5 Solution import java.io.*; import java.util.*; import java.util.ArrayList; public class Payroll { public static void main(String[] args) { Scanner input = new Scanner(System.in); String fName = null; String lName = null; int dept = 0; double eSalary = 0.0; int numDeps = 0; String dfName = null; String dlName = null; Employee e = null; int choice; System.out.println("Enter first Name"); fName=input.next(); System.out.println("Enter last Name"); lName = input.next(); System.out.println("Enter no. of dept."); dept = input.nextInt(); do {
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
System.out.println("Enter the salary :"); eSalary = input.nextInt(); if (eSalary < 0.0) System.out.println("Pay rate must be >= 0"); } while (eSalary < 0.0); e = new Employee(fName, lName, dept, eSalary); System.out.println("How many dependents?"); numDeps = input.nextInt(); for (int d = 0; d < numDeps; d++) { System.out.println("Enter dependent first Name"); dfName = input.next();
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/28/2011 for the course COMPUTER S 113 taught by Professor Dr.safwanqasem during the Spring '11 term at King Saud University.

Page1 / 4

CSC113_Lab5_Solution - KSU / CCIS CSC113 Lab 5 Inheritance...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online