Question

In: Electrical Engineering

write a programme named question5a.cpp that calculate and print pay slip

write a programme named question5a.cpp that calculate and print pay slip

Solutions

Expert Solution

Program code:

#include<iostream>

using namespace std;

class Emp

{

int id;

char name[100];

float basicsalary, hra, da, tax, net_salary;

public:

void accept()

{

cout<<"\n Enter Employee Id : ";

cin>>id;

cout<<"\n Enter Employee Name : ";

cin>>name;

cout<<"\n Enter Basic Salary : ";

cin>>basicsalary;

hra = 1000;

da = 0.25 * basicsalary;

tax = 0.15 * basicsalary;

net_salary = basicsalary + da + hra - tax;

}

void disp()

{

cout<<"\n ----------------------- ";

cout<<"\n Employee Id : "<<id;

cout<<"\n Employee Name : "<<name;

cout<<"\n Basic Salary : "<<basicsalary;

cout<<"\n HRA : "<<hra;

cout<<"\n DA : "<<da;

cout<<"\n I-Tax : "<<tax;

cout<<"\n Net Salary : "<<net_salary;

}

};

int main()

{

Emp e;

e.accept();

e.disp();

return 0;

}


Related Solutions

Exercise 1. Write a function named printBox to print a 5 x 10 box of asterisks...
Exercise 1. Write a function named printBox to print a 5 x 10 box of asterisks using nested loops. When printBox() is called your function should display the pattern shown below. Write a function named printBox to print a 5 x 10 box of asterisks using nested loops. When printBox() is called your function should display the following information. ********** ********** ********** ********** ********** """ # place the code for the printBox function here printBox( numRows, numCols ) Exercise 2....
Write a program named subtract.asm that does the following using LC3 assembly language: Print a prompt...
Write a program named subtract.asm that does the following using LC3 assembly language: Print a prompt "PRESS TWO KEYS: " Note that the prompt MUST LOOK EXACTLY like the above, with a colon and a space after the word KEYS with no newline. Get a two key press from the user. Subtract the second characters ASCII code from the first characters ASCII code. If the result is positive, print the word POSITIVE. Turn in subtract.asm to the appropriate submission point...
Using C++ code, write a program named q5.cpp to print the minimum of the sums x...
Using C++ code, write a program named q5.cpp to print the minimum of the sums x + y^3 and x^3 + y, where x and y are input by a user via the keyboard.
PL/SQL Write a PL/SQL block, using a While Loop, to calculate and print the sum of...
PL/SQL Write a PL/SQL block, using a While Loop, to calculate and print the sum of the odd integers from 10 to 120 inclusive. (Hint: 11 + 13 + 15 + . . . + 97 + 99)
Design and write a function to calculate a person’s pay for a variable number of hours...
Design and write a function to calculate a person’s pay for a variable number of hours worked. ● Create a constant called HOURLY_RATE set to 24.95 ● To Consider - should this be local to the function or global? ● Ask the user to enter their number of hours worked (do this inside the function). Remember to always use meaningful variable names for variables! ● Then calculate and return their total pay Add code to main which will call this...
1(a). You are required to interface and write sample programme to test the operation of the...
1(a). You are required to interface and write sample programme to test the operation of the following devices of the microcontroller board, namely (i) Push Buttons (ii) LEDs (iii) Analog input (using the potentiometer) (b). A LED is to be interfaced to pin 3 of the microcontroller board. Please draw the necessary hardware circuit to show the connection. Write a sample software to glow the LED with ON time 1 sec and OFF time 1 sec. (microcontroller is Arduino)
Write a program to help a small company calculate the amount of money to pay its...
Write a program to help a small company calculate the amount of money to pay its employees. In this simplistic world, the company has exactly three employees. However, the number of hours per employee may vary. The company will apply the same tax rate to every employee The program must be written in Java. Prompt the user for the inputs and store the values in variables Must include all the inputs and outputs listed here and perform the calculations correctly...
Using C++ Write a program to calculate the amount a customer should pay in a checkout...
Using C++ Write a program to calculate the amount a customer should pay in a checkout counter for the purchases in a bagel shop. The products sold are bagels, cream cheese, and coffee. Use the pseudo code discussed in the class to write the program. Make reasonable assumptions about the prices of bagel, cream cheese, and coffee. Declare prices of bagel, cream cheese, and coffee as constants.
Why we cannot print money to pay back the debt
Why we cannot print money to pay back the debt
Assignment: (Save this file as A7-1.cpp) Write a program to calculate the gross pay for an...
Assignment: (Save this file as A7-1.cpp) Write a program to calculate the gross pay for an assembly line employee that works for a company that pays all assembly line workers $7.50 hour. Any employee that works over 40 hours per week is compensated by being paid time-and-one-half for each hour over 40. a. Use main( ) as the driver function. Allow the user to compute as many employees as desired. b. Write the function getName( ) that prompts for the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT