Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


Assignment No. 3
Semester: Fall 2010

CS201: Introduction to Programming

Total Marks: 20

 

Due Date: 06 Jan, 2011

 

Instructions:

Please read the following instructions carefully before submitting your assignment:

It should be clear that your assignment will not get any credit if:

 

§         The assignment is submitted after due date.

§         The submitted assignment does not open or file is corrupt.

 

All types of plagiarism are strictly prohibited.

 

Note: You have to upload only .cpp file. Assignment in any other format (extension) will not be accepted. If you will submit code any other file format like .doc or .txt etc. you will
get zero marks.

 

Objective

The objective of this assignment is to provide hands on experience of using

 

§         Functions of C/C++

§         Classes in C/C++

§         Creating and manipulating objects.

 

Guidelines

§         Code should be properly aligned and well commented.

§         Follow C/C++ rules while writing variables names, function names etc.

§         Use only Dev-C++ IDE for this assignment.

 

Assignment

 

 

Problem Statement: Calculate salary

 

You are required to write a program which will calculate the salary of an employee according to his/her grade assigned by the employer. You must
declare a class named CalSalary whose private data members
will be employee ID, employee name and employee grade. Also write a
constructor, setter and getter functions for all private data members and a
function that will calculate the salary.

 

 

 

Detailed Description:

  • Employee ID and grade should be of type integer. Employee name should be of type string.
  • Constructor should initialize employee ID and grade with value zero and employee name with value NULL.
  • For assigning or extracting values from private data members, you must use getter and setter functions.
  • Declare a public member function named calculate which will calculate the net salary of the employee according to his/her grade.
  • Formula for calculating actual salary is (Basic Salary) + 45% of basic salary.
  • If the grade of employee is 17, then the basic salary is 15,000.
  • If the grade is 18, then the basic salary is 20,000 and if grade is 19 then the basic salary is 25,000.

 

Sample Output 1

 

Please enter employee ID : 001

Please enter employee name : Mohammad Ali

Please enter employee grade : 17

 

The net salary of Mohammad Ali is Rs.21750

 

 

 

Sample Output 2

 

Please enter employee ID : 2

Please enter employee name : Aslam Khan

Please enter employee grade : 19

 

The net salary of Aslam Khan is Rs.36250

 

 

 

Note: you have to use same Class and Function name as mentioned in the assignment details. If we find any deviation, marks will be deducted.

 

Deadline:

Your Assignment solution must be submitted on or before January 06, 2011.

 

 Please Discuss here about this assignment> Thanks

For complete assignment.see the attached file pls

 

Views: 230

Attachments:

Replies to This Discussion

please share solutions for idea....
plzzzzzzzzzz koi solution share krayyyyyyyyyyy
Manni bhi app he kuch karo please
ok
Attachments:
sir g yeh assignment 1 ka solution hai humay 3 ka c

my code is giving error, can anyone share for reference

upload your code then i will correct

i was busy and no time to write plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

Check any body this some code but not show the out put commenting and correct and tell me abourt this
Attachments:
++Deewan** bhai ager exe format main assignment share kero gay to coding kasa dakhain gay hum aur kia masla hay yeah kidher say pata chaly ga?

sochoo...

CS201
#include<iostream.h>
#include<string.h>
#include<conio.h>

class calsalary
{
    private:
        int empID,empGrade;
        char empName[20];
        int salary;
      public:
          calsalary()
          {
              empID=0;
              empGrade=0;
              strcpy(empName," ");
              salary=0;
          }
          void getData()
          {
              cout"please enter employee ID:";
              cin>>empID;
              cout"Please enter employee Name:";
              cin>>empName;
              cout"Please enter employee Grade:";
              cin>>empGrade;
          }
          int calculate(int grade)
          {
              switch(grade)
              {
                  case 17:
                      salary=15000+(15000*45/100);
                      break;
                  case 18:
                      salary=20000+(20000*45/100);
                      break;
                  case 19:
                      salary=25000+(25000*45/100);
                      break;
                  default:
                      cout "Your typed Grade in not listed";
                      break;
         }
         return salary;
     }
     void setData()
     {
         cout"The net salary of" empName " is Rs." calculate(empGrade)endl;
     }
    
     ~calSalary()
     {
     }
 };
 int main(void)           
 {
     calSalary obj1;
     obj1.getData();
     obj1.setData();
    
     system("pause");
     return 0;

See the attached file for another idea solution
Attachments:

RSS

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

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