Skip to content

MyUstaadG

Learn to Serve

  • Computer Science
    • Software
    • Computer Tips
    • Coding
      • Conditional Structures Exercises
      • Loops Exercises
      • Arrays Exercises
      • Python Exercises
    • Microsoft Office
      • MS Excel
      • MS Word
  • Videos
    • Funny Videos
    • Health and Fitness Videos
    • PUBG Videos
    • Technology Videos
  • News
  • Funny
  • Memes
  • Playwright Tutorials
  • Tutorials
  • Toggle search form

Write a program that inputs employees code, names, and salaries of 10 employees in three arrays ‘code’, ‘name’, and ‘salary’ It computes the net salary.

Posted on October 26, 2021 By myustaadg.com
Spread the love
Write a program that inputs employees code, names, and salaries of 10 employees in three arrays ‘code’, ‘name’, and ‘salary’ It computes the net salary. If the salary is 250000 or more, it deducts 13% of the salary. If the salary is 150000 or more but less than 250000, it deducts 1500 from the salary.

So let’s Write Code:

Introduction to C++ Programming | Download and Install Dev C++ Compiler

Let’s build logic First:

Code:

Write a program that inputs employees code, names, and salaries of 10 employees in three arrays ‘code’, ‘name’, and ‘salary’ It computes the net salary.

#include<iostream>
using namespace std;
main()
{
int emp_code[10], i;
float emp_salary[10], net_salary;
char emp_names[10][25];
i = 0;
while(i<=9)
{
cout<<endl<<"Enter record of employee : "<<i+1<<endl;
cout<<"Employee code : ";
cin>>emp_code[i];
cout<<"Employee name : ";
cin>>emp_names[i];
cout<<"Employee Salary : ";
cin>>emp_salary[i];
i++;
}

i = 0;
while(i<=9)
{
if(emp_salary[i] >=250000)
net_salary = emp_salary[i] - emp_salary[i] *10.0/100;
else if(emp_salary[i] >=150000)
net_salary = emp_salary[i] - 1500;
cout<<endl<<"Record of employee # "<<i+1<<endl;
cout<<"Employee code : "<<emp_code[i]<<endl;
cout<<"Employee name : "<<emp_names[i]<<endl;
cout<<"Employee Salary : "<<emp_salary[i]<<endl;
cout<<"Employee Net Salary : "<<net_salary;
cout<<endl;
i++;
}
}

Hope You will learn Something. Happy Coding.

Visit my YouTube Channel as Well😇 https://www.youtube.com/watch?v=JuIHQ9cLSEw&list=PLbIhkHxfUIItTdcyCb34uRIrPJbXBndIl&index=4

Click on the below Links for more Programming Exercises:

Conditional Structure Exercises: 👉https://myustaadg.com/category/programming-exercises/conditional-structures-exercises/

Array Exercises: 👉https://myustaadg.com/category/programming-exercises/arrays-exercises/

Arrays Exercises, Programming Exercises Tags:Array declaration and initialiaztion in c++, Array Exercises, array Exercises in c, Array exercises in C++, array in programming, array with example, Arrays, arrays code, arrays declaration in C++, Arrays in C++, arrays in c++ programming, c++ algorithm, c++ array declaration and initailization, C++ arrays programming exercises, c++ arrays tutorials, C++ programming exercises: Array, c++ tutorials, hoe to decare a array in c++, how to initalize a array in c++, how to write algoritum for array, initialize arrays in c++, program to computes the net salary. If the salary is 250000 or more it deducts 13% of the salary. If the salary is 150000 or more but less than 250000 it deducts 1500 from the salary., Write a program that inputs employees code names and laries of 10 employees in three arrays ‘code’ ‘name’ and ‘salary’

Post navigation

Previous Post: Write a program that inputs ages of different persons in an array and counts the number of persons that have ages between 65 and 80.
Next Post: Write a program that uses three arrays ‘A’, ‘B’, and ‘C’. It inputs integer values in array ‘A’. In second array ‘B’, it stores the squares of values of array ‘A’ and in third array ‘C’, it stores cubes of the values of ‘A’.

More Related Articles

Write a program to enter the temperature of a week and determine the maximum temperature, minimum temperature and average temperature. Arrays Exercises
Write a program that inputs 10 numbers into an array and finds out the second largest value from that array. Arrays Exercises
Write a program that initializes values 2, 6, 3, 5, 4 and 7 in one-dimensional array and computes the factorial. Arrays Exercises
Write a program that asks the user for two numbers and shows their division on the screen. If the divisor is zero the program must display an error | Python Programming Programming Exercises
Write a program that inputs values into int type array. It reads the value from array and draws a bar chart by printing asterisks. Arrays Exercises
Write a program which input age from user and display on the screen if he/she is of legal age or not | Python Programming Programming Exercises

Copyright © 2022 MyUstaadG.

Powered by PressBook Blog WordPress theme