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...
-
Is it scattering or reflection that accounts for the whiteness of a cloud?
-
According to the rule for optimal input usage, a firm should hire a person as long as her marginal revenue product is greater than her marginal cost to the company. It is well known that many...
-
Consider the gasoline mileage data in Table B.3. Delete eight observations (chosen at random) from the data and develop an appropriate regression model. Use this model to predict the eight withheld...
-
Perry Co. predicts it will use 25,000 units of material during the year. The expected daily usage is 200 units, and there is an expected lead time of five days and a desired safety stock of 500...
-
On January 1 , 2 0 2 0 , Tamarisk Corporation had $ 2 , 0 0 0 , 0 0 0 of $ 1 0 par value common stock outstanding that was issued at par and retained earnings of $ 1 , 1 0 0 , 0 0 0 . The company...
-
Diana and Ryan Workman were married on January 1 of last year. Diana has an eight-year-old son, Jorge, from her previous marriage. Ryan works as a computer programmer at Datafile Inc. (DI) earning a...
-
Darryl received several acres of land from his mother as a gift. At the time of the gift, the land had a fair market value of $95,000. The mother's adjusted basis in the land was $105,000. Two years...
-
In the medicine market, there is a difference between the demand for medicines produced under a patent, medicines that have a well-established brand (such as Bayer) and generic medicines. Discuss the...
-
Discussion Part 1: Explore the Internet for the following information about economic development committees. Note that some information you find may be generic and, therefore, you need to extrapolate...
-
How does our bureaucracy intersect with healthcare? Overview Select a federal or tribal medical agency to research : HHS, CDC, CMS, USDA (SNAP Program), Indian Health Services, VHA. Instructions...
-
Access the St. Louis FRED website and find the actual velocity of money (M1). Is the velocity of money constant? Comment on the velocity of money pre and post Covid. (What story do the numbers tell...
-
Explain the OBPS and relate it to the emissions Tax system . For example, you might begin by outlining the textbook-type emissions tax system and then use it to illustrate that the OBPS is just a...
-
A firm is making a product that has a fixed cost of $13,500 and a variable cost of $31.50/unit. If the product sells for $36.00/unit, how many units does the company have to sell to breakeven?
-
According to a recent survey, 40% of millennials (those born in the 1980s or 1990s) view themselves more as spenders than savers. The survey also reveals that 75% of millennials view social...
-
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...
-
In the 2016 Olympics in Rio, after the 50 m freestyle competition, a problem with the pool was found. In lane 1 there was a gentle 1.2 cm/s current flowing in the direction that the swimmers were...
-
A soccer player takes a free kick from a spot that is 20 m from the goal. The ball leaves his foot at an angle of 32, and it eventually hits the crossbar of the goal, which is 2.4 m from the ground....
-
The moon completes one (circular) orbit of the earth in 27.3 days. The distance from the earth to the moon is 3.84 10 8 m. What is the moons centripetal acceleration?
Study smarter with the SolutionInn App