SlideShare a Scribd company logo
1 of 2
Download to read offline
Write a C++ program with a function defined to give the person a 20% raise?
Please explain. Thanks
Write a C++ program with a function defined to give the person a 20% raise?
Please explain. Thanks
Please explain. Thanks
Solution
#include
#include
#define SIZE 5 // we are defining the size of entries / variables to 5
class emp
{
float basic,da,it,netsal; // salary , da and netsalary are mentioned in float
char name[20],num[10];
public:
void getdata(); // function to get employee data
void net_sal(); // function to get employee salary
void sal_hike(); // fuction to display hike based on net salary
void dispdata(); // to dislay data
};
void emp::getdata() // enter basic employee details
{
cout<<" Enter employee number: " ;
cin>>name;
cout<<" Enter employee name: " ;
cin>>num;
cout<<"Enter employee basic salary in Rs: " ;
cin>>basic;
}
void emp::net_sal() // calculate net salary
{
da=((0.52)*basic );
float gsal=da+basic;
it=((0.3)*gsal);
netsal=gsal-it;
}
void emp::sal_hike() // compute salary hike
int hike=net_sal + 0.2*net_sal;
}
void emp::dispdata() // to display data
{
cout
<<" Employee number: "<>n;
for(int i=0;i

More Related Content

Similar to Write a C++ program with a function defined to give the person a .pdf

Cis407 a ilab 5 web application development devry university
Cis407 a ilab 5 web application development devry universityCis407 a ilab 5 web application development devry university
Cis407 a ilab 5 web application development devry university
lhkslkdh89009
 
Using C++...Hints- Use binary file readwrite to store employee .pdf
Using C++...Hints- Use binary file readwrite to store employee .pdfUsing C++...Hints- Use binary file readwrite to store employee .pdf
Using C++...Hints- Use binary file readwrite to store employee .pdf
fashionfolionr
 
Having issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfHaving issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdf
rajkumarm401
 
Labsheet 7 FP 201
Labsheet 7 FP 201Labsheet 7 FP 201
Labsheet 7 FP 201
rohassanie
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
rafbolet0
 
I got the codes written down below- Basically- I am trying to implemen.pdf
I got the codes written down below- Basically- I am trying to implemen.pdfI got the codes written down below- Basically- I am trying to implemen.pdf
I got the codes written down below- Basically- I am trying to implemen.pdf
shreeaadithyaacellso
 
Cis 407 i lab 5 of 7
Cis 407 i lab 5 of 7Cis 407 i lab 5 of 7
Cis 407 i lab 5 of 7
helpido9
 
Make sure to make a copy of the Google Doc for this lab into.pdf
Make sure to make a copy of the Google Doc for this lab into.pdfMake sure to make a copy of the Google Doc for this lab into.pdf
Make sure to make a copy of the Google Doc for this lab into.pdf
adityastores21
 

Similar to Write a C++ program with a function defined to give the person a .pdf (20)

C++ lab assignment
C++ lab assignmentC++ lab assignment
C++ lab assignment
 
Functions.pptx
Functions.pptxFunctions.pptx
Functions.pptx
 
COW
COWCOW
COW
 
Cis407 a ilab 5 web application development devry university
Cis407 a ilab 5 web application development devry universityCis407 a ilab 5 web application development devry university
Cis407 a ilab 5 web application development devry university
 
Using C++...Hints- Use binary file readwrite to store employee .pdf
Using C++...Hints- Use binary file readwrite to store employee .pdfUsing C++...Hints- Use binary file readwrite to store employee .pdf
Using C++...Hints- Use binary file readwrite to store employee .pdf
 
Oop concept in c++ by MUhammed Thanveer Melayi
Oop concept in c++ by MUhammed Thanveer MelayiOop concept in c++ by MUhammed Thanveer Melayi
Oop concept in c++ by MUhammed Thanveer Melayi
 
2. Create a Java class called EmployeeMain within the same project Pr.docx
 2. Create a Java class called EmployeeMain within the same project Pr.docx 2. Create a Java class called EmployeeMain within the same project Pr.docx
2. Create a Java class called EmployeeMain within the same project Pr.docx
 
Oops presentation
Oops presentationOops presentation
Oops presentation
 
Having issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfHaving issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdf
 
Plsql programs(encrypted)
Plsql programs(encrypted)Plsql programs(encrypted)
Plsql programs(encrypted)
 
Labsheet 7 FP 201
Labsheet 7 FP 201Labsheet 7 FP 201
Labsheet 7 FP 201
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
 
I got the codes written down below- Basically- I am trying to implemen.pdf
I got the codes written down below- Basically- I am trying to implemen.pdfI got the codes written down below- Basically- I am trying to implemen.pdf
I got the codes written down below- Basically- I am trying to implemen.pdf
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4
 
Cis 407 i lab 5 of 7
Cis 407 i lab 5 of 7Cis 407 i lab 5 of 7
Cis 407 i lab 5 of 7
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdf
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual final
 
February0504 pm
February0504 pmFebruary0504 pm
February0504 pm
 
Make sure to make a copy of the Google Doc for this lab into.pdf
Make sure to make a copy of the Google Doc for this lab into.pdfMake sure to make a copy of the Google Doc for this lab into.pdf
Make sure to make a copy of the Google Doc for this lab into.pdf
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 

More from arihantgiftgallery

In Drosophila, gray body color is dominant to ebony body color, while.pdf
In Drosophila, gray body color is dominant to ebony body color, while.pdfIn Drosophila, gray body color is dominant to ebony body color, while.pdf
In Drosophila, gray body color is dominant to ebony body color, while.pdf
arihantgiftgallery
 
I need help with this maze gui that I wrote in java, I am trying to .pdf
I need help with this maze gui that I wrote in java, I am trying to .pdfI need help with this maze gui that I wrote in java, I am trying to .pdf
I need help with this maze gui that I wrote in java, I am trying to .pdf
arihantgiftgallery
 
Explain how particles of different sizes are cleared from different a.pdf
Explain how particles of different sizes are cleared from different a.pdfExplain how particles of different sizes are cleared from different a.pdf
Explain how particles of different sizes are cleared from different a.pdf
arihantgiftgallery
 
Egineering Ethics Planned obsolescence is the practice of producing.pdf
Egineering Ethics Planned obsolescence is the practice of producing.pdfEgineering Ethics Planned obsolescence is the practice of producing.pdf
Egineering Ethics Planned obsolescence is the practice of producing.pdf
arihantgiftgallery
 
Endospores do not stain easily Perhaps you have seen them as unstain.pdf
Endospores do not stain easily Perhaps you have seen them as unstain.pdfEndospores do not stain easily Perhaps you have seen them as unstain.pdf
Endospores do not stain easily Perhaps you have seen them as unstain.pdf
arihantgiftgallery
 
Describe how the concepts of leadership and management differ from e.pdf
Describe how the concepts of leadership and management differ from e.pdfDescribe how the concepts of leadership and management differ from e.pdf
Describe how the concepts of leadership and management differ from e.pdf
arihantgiftgallery
 
Contemporary historyFor each year since 1945, select an event that.pdf
Contemporary historyFor each year since 1945, select an event that.pdfContemporary historyFor each year since 1945, select an event that.pdf
Contemporary historyFor each year since 1945, select an event that.pdf
arihantgiftgallery
 

More from arihantgiftgallery (20)

In Drosophila, gray body color is dominant to ebony body color, while.pdf
In Drosophila, gray body color is dominant to ebony body color, while.pdfIn Drosophila, gray body color is dominant to ebony body color, while.pdf
In Drosophila, gray body color is dominant to ebony body color, while.pdf
 
I need help with this maze gui that I wrote in java, I am trying to .pdf
I need help with this maze gui that I wrote in java, I am trying to .pdfI need help with this maze gui that I wrote in java, I am trying to .pdf
I need help with this maze gui that I wrote in java, I am trying to .pdf
 
G and g are dominant and recessive alleles, respectively, for a gene.pdf
G and g are dominant and recessive alleles, respectively, for a gene.pdfG and g are dominant and recessive alleles, respectively, for a gene.pdf
G and g are dominant and recessive alleles, respectively, for a gene.pdf
 
Explain how particles of different sizes are cleared from different a.pdf
Explain how particles of different sizes are cleared from different a.pdfExplain how particles of different sizes are cleared from different a.pdf
Explain how particles of different sizes are cleared from different a.pdf
 
Egineering Ethics Planned obsolescence is the practice of producing.pdf
Egineering Ethics Planned obsolescence is the practice of producing.pdfEgineering Ethics Planned obsolescence is the practice of producing.pdf
Egineering Ethics Planned obsolescence is the practice of producing.pdf
 
Endospores do not stain easily Perhaps you have seen them as unstain.pdf
Endospores do not stain easily Perhaps you have seen them as unstain.pdfEndospores do not stain easily Perhaps you have seen them as unstain.pdf
Endospores do not stain easily Perhaps you have seen them as unstain.pdf
 
Describe how the concepts of leadership and management differ from e.pdf
Describe how the concepts of leadership and management differ from e.pdfDescribe how the concepts of leadership and management differ from e.pdf
Describe how the concepts of leadership and management differ from e.pdf
 
Contemporary historyFor each year since 1945, select an event that.pdf
Contemporary historyFor each year since 1945, select an event that.pdfContemporary historyFor each year since 1945, select an event that.pdf
Contemporary historyFor each year since 1945, select an event that.pdf
 
A variety of media and culture conditions can be used to culture and .pdf
A variety of media and culture conditions can be used to culture and .pdfA variety of media and culture conditions can be used to culture and .pdf
A variety of media and culture conditions can be used to culture and .pdf
 
A program consists of 4 musical numbers and 3 speeches. In how many .pdf
A program consists of 4 musical numbers and 3 speeches. In how many .pdfA program consists of 4 musical numbers and 3 speeches. In how many .pdf
A program consists of 4 musical numbers and 3 speeches. In how many .pdf
 
A Moving to another question will save this response. Question 4 Iden.pdf
A Moving to another question will save this response. Question 4 Iden.pdfA Moving to another question will save this response. Question 4 Iden.pdf
A Moving to another question will save this response. Question 4 Iden.pdf
 
A plant with a very extensive root system would be able to better abs.pdf
A plant with a very extensive root system would be able to better abs.pdfA plant with a very extensive root system would be able to better abs.pdf
A plant with a very extensive root system would be able to better abs.pdf
 
property, plant, and equipment are categorized as property, pla.pdf
property, plant, and equipment are categorized as property, pla.pdfproperty, plant, and equipment are categorized as property, pla.pdf
property, plant, and equipment are categorized as property, pla.pdf
 
Write a program in Matlab using Newtons method to solve this syste.pdf
Write a program in Matlab using Newtons method to solve this syste.pdfWrite a program in Matlab using Newtons method to solve this syste.pdf
Write a program in Matlab using Newtons method to solve this syste.pdf
 
Why is it that bacterial ribosomes can begin translation before mRNA.pdf
Why is it that bacterial ribosomes can begin translation before mRNA.pdfWhy is it that bacterial ribosomes can begin translation before mRNA.pdf
Why is it that bacterial ribosomes can begin translation before mRNA.pdf
 
Which standards organization defined the Ethernet standardA.IEEE.pdf
Which standards organization defined the Ethernet standardA.IEEE.pdfWhich standards organization defined the Ethernet standardA.IEEE.pdf
Which standards organization defined the Ethernet standardA.IEEE.pdf
 
When the pH of a solution changes from 2 to 6 a) That solution beco.pdf
When the pH of a solution changes from 2 to 6 a) That solution beco.pdfWhen the pH of a solution changes from 2 to 6 a) That solution beco.pdf
When the pH of a solution changes from 2 to 6 a) That solution beco.pdf
 
Which is the correct answer Consider the characteristics of moss an.pdf
Which is the correct answer Consider the characteristics of moss an.pdfWhich is the correct answer Consider the characteristics of moss an.pdf
Which is the correct answer Consider the characteristics of moss an.pdf
 
Unequal crossing over is responsible for creating paracentric inversi.pdf
Unequal crossing over is responsible for creating paracentric inversi.pdfUnequal crossing over is responsible for creating paracentric inversi.pdf
Unequal crossing over is responsible for creating paracentric inversi.pdf
 
Using java script for an html page how do you add a name to a locati.pdf
Using java script for an html page how do you add a name to a locati.pdfUsing java script for an html page how do you add a name to a locati.pdf
Using java script for an html page how do you add a name to a locati.pdf
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Recently uploaded (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 

Write a C++ program with a function defined to give the person a .pdf

  • 1. Write a C++ program with a function defined to give the person a 20% raise? Please explain. Thanks Write a C++ program with a function defined to give the person a 20% raise? Please explain. Thanks Please explain. Thanks Solution #include #include #define SIZE 5 // we are defining the size of entries / variables to 5 class emp { float basic,da,it,netsal; // salary , da and netsalary are mentioned in float char name[20],num[10]; public: void getdata(); // function to get employee data void net_sal(); // function to get employee salary void sal_hike(); // fuction to display hike based on net salary void dispdata(); // to dislay data }; void emp::getdata() // enter basic employee details { cout<<" Enter employee number: " ; cin>>name; cout<<" Enter employee name: " ; cin>>num; cout<<"Enter employee basic salary in Rs: " ; cin>>basic; }
  • 2. void emp::net_sal() // calculate net salary { da=((0.52)*basic ); float gsal=da+basic; it=((0.3)*gsal); netsal=gsal-it; } void emp::sal_hike() // compute salary hike int hike=net_sal + 0.2*net_sal; } void emp::dispdata() // to display data { cout <<" Employee number: "<>n; for(int i=0;i