.... How to Find Your Subject Study Group & Join ....   .... Find Your Subject Study Group & Join ....  

We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Study Groups By Subject code Wise (Click Below on your university link & Join Your Subject Group)

[ + VU Study Groups Subject Code Wise ]  [ + COMSATS Virtual Campus Study Groups Subject Code Wise ]

Looking For Something at vustudents.ning.com?Search Here

Lectures Covered : 27-30


Objective
:
The objective of this assignment is to enhance knowledge of Java Programming:
1. It will increase learning of Java data types, classes concepts
2. Hand on experience of arrays
3. Students will be able to implement Inheritance and Over riding


Instructions:
Please read the following instructions carefully before solving & submitting the assignment:
1. The assignment will not be accepted after due date.
2. Zero marks will be awarded to the assignment that does not open or the file is
corrupt.
3. The assignment file must be MS Word (.doc) file format; Assignment will not be
accepted in any other format.
4. Zero marks will be awarded to the assignment if copied (from other student or copied
from handouts or internet).
5. Zero marks will be awarded to the assignment if the Student ID is not mentioned in
the assignment file.
Note: All types of plagiarism are strictly prohibited. Copy cases will be awarded
zero marks.

Question No 1:
Suppose a textile company “Grace Textile” human resource (HR) department. It has total 80
employees in 3 different branches. Employees are of 3 categories: Internees, Contract and Permanent
employees. Internees have internship of 6 months with fixed salary i.e, 20 thousand. Salaries are
calculated on basis of grades. Both contract and permanent employees have different pay scales.
Permanent employees also got benefits of pension and gratuity .Contract employees get monthly
salary and an annual additional bonus.
You are required to write a Java program comprising :
Three Classes Employee, Contract Employee, Permanent Employee
Employee class will have basic attributes of “Employee Id”, CNIC, Name, Grade, Salary and
Category (Internee, Contract, and Permanent). Use “I” for internee, “C” for “Contract” and
“P” for permanent
CNIC will be of format 123-456-789
Contract Employee class will have attributes/data members of Employee class and an
additional member “Bonus”
Permanent Employee class will have attributes of Employee class along with 2 additional
attributes “Gratuity” and “Pension”
Use proper data types for all data members
Write display message of base class and derived classes which will print Emp Id of respective
class
Write a function for Contract Employee Class that will calculate bonus. Roll number will be
stored in an array. Roll number will be your own vu id only digits (8 digits excluding first 2
characters). E.g, If your Roll number is BC12345678, 12345678 will be stored in array. Add
all 8 digits and name it “sum
”. Calculate bonus with formula: (sum*1000)/2; Print value of
bonus.
Steps to Compile /Execute Java Program:

Open following link :
http://www.compileonline.com/compile_java8_online.php
Here you can compile and execute your Java Code with(JDK 1.8.0)*.
1. Paste/replace your code
2.
“Execute” program
3. Take screen shot of code plus result
4. Copy it in .doc file
5. Your assignment should be in .doc or .docx format
Hints: You will use inheritance and overriding for display function.

Share This With Friends......


How to Find Your Subject Study Group & Join.

Find Your Subject Study Group & Join.

+ Click Here To Join also Our facebook study Group.


This Content Originally Published by a member of VU Students.

+ Prohibited Content On Site + Report a violation + Report an Issue

+ Safety Guidelines for New + Site FAQ & Rules + Safety Matters

+ Important for All Members Take a Look + Online Safety


Views: 3133

See Your Saved Posts Timeline

Attachments:

Replies to This Discussion

plz start disscution about Assignment # 2.....

sub soo rahey hi kiya

koi idea

today last day

sab so rhy hain yahan

ap ne khud try kia ?


public class Employee
{
private int id;
private int cnic;
private String name;
private int grade;
private int salary;
private String categ;

public Employee( int employeeId, int employeeCnic, String employeeName, int employeeGrade, int employeeSalary, String employeeCateg)
{
id = employeeId;
cnic = employeeCnic;
name = employeeName;
grade = employeeGrade;
salary = employeeSalary;
categ = employeeCateg;

}
Employee()
{
System.out.println("Enter ID of the Employee:");
id = get.nextLine();
System.out.println("Enter CNIC of the Employee:");
cnic = get.nextLine();
System.out.println("Enter Name of the Employee:");
name = get.nextLine();
System.out.println("Enter Grade:");
grade = get.nextInt();
System.out.println("Enter Salary of the Employee:");
salary = get.nextLine();
System.out.println("Enter Category of the Employee (I, C, P):");
categ = get.nextLine();
}
void display()
{
System.out.println("Employee ID: "+ id);
System.out.println("Employee CNIC: "+ cnic);
System.out.println("Employee Name: "+ name);
System.out.println("Grade: "+ grade);
System.out.println("Salary: "+ salary);
System.out.println("Category: "+ categ);
}
class contractEmployee extends Employee
{
int bonus;
contractEmployee()
{
System.out.println("Enter Grade: ");
grade = get.nextInt();
System.out.println("Enter Salary:");
salary = get.nextFloat();
}
void display()
{
System.out.println("=============================="+"\n"+"Full Time Employee Details"+"\n"+"=============================="+"\n");
super.display();
System.out.println("Salary: "+salary);
System.out.println("Designation: "+ grade);
}
}
class permanentEmployee extends Employee
{
int gratuatiy, pension;
permanentEmployee()
{
System.out.println("Enter Number of Working Hours:");
gratuatiy = get.nextInt();
}
void calculatepay()
{
pension = ;
}

void display()
{
System.out.println("=============================="+"\n"+"Part Time Employee Details"+"\n"+"=============================="+"\n");
super.display();
System.out.println("Number of Working Hours: "+pension);
System.out.println("Salary for "+gratuatiy+" working hours is: $"+pension);
}
}

class Employee
{
public static void main(String args[])
{
System.out.println("================================"+"\n"+"Enter Full Time Employee Details"+"\n"+"================================"+"\n");
permanentEmployee ob1 = new permanentEmployee();
contractEmployee ob = new contractEmployee();
System.out.println("================================"+"\n"+"Enter Part Time Employee Details"+"\n"+"================================"+"\n");
ob1.display();
ob.calculatepay();
ob.display();
}
}

}

Employee.java:72: error: illegal start of expression
pension = ;

same error

Bhai logo es code ko likny k ly java install kro ya visual studio plz reply fast

kuch bi install krny ki zarort nai hy bas jo assignment ma link diya hua us ma code likho r run kro

thanx  ROMEO

any solution about this error.

RSS

Forum Categorizes

Job's & Careers (Latest Jobs)

Admissions (Latest Admissons)

Scholarship (Latest Scholarships)

Internship (Latest Internships)

VU Study

Other Universities/Colleges/Schools Help

    ::::::::::: More Categorizes :::::::::::

Member of The Month

© 2018   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service