Answered step by step
Verified Expert Solution
Question
1 Approved Answer
URGENTLY NEEDED a Exercise 3: A structure type called SalesRecord is designed to hold all necessary data regarding salesman in a company and the sales
URGENTLY NEEDED
a Exercise 3: A structure type called SalesRecord is designed to hold all necessary data regarding salesman in a company and the sales information that he or she has made. The SalesRecord structure and an array variable called salesRep are declared below: struct SalesRecord { int id; char name [30]; double quarterlySales [4]; double totalAnnual; }; SalesRecord salesRep [20]; a) A function named readRecord is designed to read the information of all the salesmen of the company from the user. Assume that the company has 20 salesmen. Below is the prototype of the function. void readRecord (SalesRecord (1) i) Write a complete definition for the function readRecord to read the salesman's id, name and quarterly sales. ii) Write a proper call statement to the function readRecord to fill in the array salesRep. b) The member totalAnnual of SalesRecord is used to hold the information about the total amount of yearly sales of each salesman respectively. The calculation of the total sale is accomplished by the following function: double getAnnualsale (double quarterlysales[]) double total = 0.0: for (int i=0; i" > id; searchRecord - gatsalesman (salesRep, id)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started