Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program that deal with employees salaries in a company, as follows: Define an integer array named salaries of size 100 Initialize all

  1. Write a C program that deal with employees’ salaries in a company, as follows:
    1. Define an integer array named salaries of size 100
    2. Initialize all array elements with zeros 
    3. Fill all array elements with random numbers within a range of 350 until 3000 (all inclusive) by using built-in-function rand() and srand()

Develop the following functions and call them from the main program:

  1. avgSalary(), a function that receives the array and its size as parameters and returns the average salary in the company
  2. printSalary(), a function that receives the array and its size as parameters and prints out all salaries in a tabular format each 10 salaries in same row.
  3. maxSalary(), a function that receives the array and its size as parameters and returns the highest salary in the company
  4. searchSalary(), a function that receives as parameters: the array and its size and the salary value to search for. The same function returns how many times this salary found in the array 
  5. sortSalary(),a function that receives the array and its size as parameters and sorts the array in descending order (from highest to lowest)

Step by Step Solution

3.45 Rating (158 Votes )

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java Programming

Authors: Joyce Farrell

9th edition

1337397075, 978-1337397070

More Books

Students also viewed these Computer Network questions

Question

Clearly distinguish among temperature, heat, and internal energy.

Answered: 1 week ago

Question

Briefly describe computer- assisted approaches to production.

Answered: 1 week ago

Question

Why is management of technology important?

Answered: 1 week ago