Write a function, named findMax for Figure Q1(c) that will return the maximum salary from the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a function, named findMax for Figure Q1(c) that will return the maximum salary from the linked list. #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 10 struct Staff{ char name [20]; double salary;); typedef struct Staff Staff; struct StaffNode ( } Staff staffData; struct StaffNode *next;); int main () ( int i; char staffName [20]; double staffSalary; struct StaffNode *head - NULL, *pl; for (i-0; i<SIZE; i++) { printf("\nEnter name:"); scanf ("%s", staff Name); printf("\nEnter salary: "); scanf("1f", éstaffSalary); pl = malloc(sizeof(struct StaffNode) ); strepy (pl->staffData.name, staffName); pl->staffData.salary = staffSalary; pl->next NULL; NULL) if (head head pl; else pl->next head; head p1;} return 0; Figure Q1(c) Write a function, named findMax for Figure Q1(c) that will return the maximum salary from the linked list. #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 10 struct Staff{ char name [20]; double salary;); typedef struct Staff Staff; struct StaffNode ( } Staff staffData; struct StaffNode *next;); int main () ( int i; char staffName [20]; double staffSalary; struct StaffNode *head - NULL, *pl; for (i-0; i<SIZE; i++) { printf("\nEnter name:"); scanf ("%s", staff Name); printf("\nEnter salary: "); scanf("1f", éstaffSalary); pl = malloc(sizeof(struct StaffNode) ); strepy (pl->staffData.name, staffName); pl->staffData.salary = staffSalary; pl->next NULL; NULL) if (head head pl; else pl->next head; head p1;} return 0; Figure Q1(c)
Expert Answer:
Answer rating: 100% (QA)
Code in C include include Define a node structure for the linked list struct Node int salary struct Node next Function to create a new node struct Nod... View the full answer
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Posted Date:
Students also viewed these programming questions
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Here are definitions of sequences and trees with integer elements: type iseq = Nil | Cons of int * (unit -> iseq) type itree = Leaf of int | Branch of itree * itree (a) In an ascending sequence such...
-
Payroll Assignment - (50 Marks) The following employees are working in the ABC Clinic, they are paid biweekly. Calculate the gross income, net income, and the total remittance that ABC is to report...
-
What is the effect on the color of a cloud when it contains an abundance of large droplets?
-
For Roche Inc., variable manufacturing overhead costs are expected to be $20,000 in the first quarter of 2017, with $5,000 increments in each of the remaining three quarters. Fixed overhead costs are...
-
In an engine working on diesel cycle, inlet pressure and temperature are 1 bar and \(20^{\circ} \mathrm{C}\). Pressure at the end of adiabatic compression is 40 bar. The ratio of expansion after...
-
Changes in various accounts and gains and losses on the sale of assets during the year for Argon Company are given below: Required: Prepare an answer sheet using the following column headings: For...
-
Gravel is being dumped from a conveyor belt at a rate of 10 cubic feet per minute. It forms a pile in the shape of a right circular cone whose base diameter and height are always the same. How fast...
-
What is a specific police department impacted by a recent legislative actions, court decisions, regulatory and statutory changes, and laws and ordinances? Analyze how the legislative actions, court...
-
0 Problem 4.8. Qualitative behavior of the probabilities (a) In Table 4.3 we considered a composite Einstein solid of four particles with two particles in each subsystem. Use the results of Table 4.3...
-
20. (10 points) Bolt manufactures steel bolts for commercial building construction. Bolt makes three types of bolts 1/8-inch, 1/4 inch and 1/2 inch. Actual and Budget operating data by product for...
-
How does the interplay between genotype and phenotype, encompassing intricate genetic regulatory networks and epigenetic modifications, contribute to the nuanced expression of traits and the...
-
Can you elaborate on the intricate molecular processes governing DNA replication, repair, and recombination, highlighting the role of sophisticated enzymatic machinery, DNA proofreading mechanisms,...
-
How do the mechanisms of ventilation and gas exchange operate synergistically in facilitating the diffusion of oxygen and carbon dioxide across the respiratory membrane, ensuring optimal...
-
How do environmental factors, such as altitude, temperature, and atmospheric composition, influence respiratory physiology, necessitating adaptive responses at both the cellular and systemic levels...
-
Locate the centroid of the composite area below. Y 50 mm 80 mm R=50mm 250mm R=65mm -- X 50 50 mm mm
-
A company has the following incomplete production budget data for the first quarter: In the previous December, ending inventory was 200 units, which was the minimum required, at 10% of projected...
-
For this assignment, you will write a program that lets the user play against the computer in a variation of the popular blackjack card game. In this variation of the game, two six-sided dice are...
-
All classes directly or indirectly inherit from this class. a. Object b. Super c. Root d. Java
-
The following are programs expressed as English statements. What would each display on the screen if they were actual programs? 1. The variable x starts with the value 0. The variable y starts with...
-
Fran frequently attends flea markets looking for good bargains. On a recent trip, she purchased a nightstand for \($25\) and an armoire for \($45.\) When she got them home and took a closer look, she...
-
Tanika passed away in the current year and her daughter, Shanika, received life insurance proceeds of \($500,000.\) Tanika had paid \($12,000\) in premiums on the life insurance policy to date....
-
Todd has received the following payments in the current year: How much must Todd include in his income? Unemployment compensation Food stamps $12,000 $ 1,500 Lottery winnings $ 1,000 Gambling...
Study smarter with the SolutionInn App