Create the following structure to hold information of a student. typedef struct { char name[50]; int...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create the following structure to hold information of a student. typedef struct { char name[50]; int id; char dept[20]; double cgpa; } student; a) Write a function void saveByDept(char *fileName, char *deptName, student allStudents[], int size) that will save the information of all students who belong to the department with name pointed to by deptName into a text file. The name of the file is given as an input parameter, filename. b) Write another function to delete the students of the department with a CGPA greater than or equal to 3 from the file you have created in part (a). Create the following structure to hold information of a student. typedef struct { char name[50]; int id; char dept[20]; double cgpa; } student; a) Write a function void saveByDept(char *fileName, char *deptName, student allStudents[], int size) that will save the information of all students who belong to the department with name pointed to by deptName into a text file. The name of the file is given as an input parameter, filename. b) Write another function to delete the students of the department with a CGPA greater than or equal to 3 from the file you have created in part (a).
Expert Answer:
Answer rating: 100% (QA)
Below is the implementation of the two functions saveByDept and deleteByCGPA c Copy code include inc... View the full answer
Related Book For
Computer Systems A Programmers Perspective
ISBN: 9781292101767
3rd Global Edition
Authors: Randal E. Bryant, David R. O'Hallaron
Posted Date:
Students also viewed these operating system questions
-
An algorithm has been written in pseudocode to input some numbers. It only outputs any numbers that are greater than or equal to 100. The number 999 is not output and stops the algorithm. INPUT...
-
/** * WEB222 - Assignment 02 * * I declare that this assignment is my own work in accordance with * Seneca Academic Policy. No part of this assignment has been * copied manually or electronically...
-
"One need not be concerned with reliability and validity in applied marketing research." Discuss this statement as a small group.
-
Write a paper in which you: Create a matrix to focus and plan data collection for your proposed evaluation, providing detailed background information about the program and the evaluation; also...
-
In the early 1990s, the FASB issued new rules that dramatically altered the way in which many companies recorded their obligations for postretirement health care benefits. The Board found that most...
-
Ronda Rousey Fight Times Perhaps the most popular fighter since the turn of the decade, Ronda Rousey is famous for defeating her opponents quickly. The five number summary for the times of her first...
-
Underestimated Inc.s common shares currently sell for $36 each. The firms management believes that its shares should really sell for $54 each. If the firm just paid an annual dividend of $2 per share...
-
1. A small company produces a product (X) that requires two types of inputs, A and B during production. Each unit of X requires exactly 5 units of A and 2.5 units of B. If the cost of A is $10 a unit...
-
Which series has the highest beta. BraveNewCoin Liquid Index for Bitcoin 1D BNC Trading Brave Ne Yellow Green Blue Orange
-
Please help me with this questions: 1. Sarah the technical communicator is working on a brochure for a new product launch. She decides to use a light blue background with dark blue text. She wants...
-
Water is being pumped from an open water reservoir at the rate of 2.0 kg/s at 10C to an open storage tank 1500 m away. The pipe used is schedule 40 3 in. pipe and the frictional losses in the system...
-
You are applying for a job with a community services organization as a communications/ human resources manager. They have asked you to submit a detailed report of what you would do to develop,...
-
How do codes of ethics affect professional, community service delivery? Question 2 Describe the steps you might follow in self-management. Question 3 Conduct appropriate research into the five-factor...
-
Write a program that accepts an integer limit and an integer value and that prints a complete line of output reporting the multiples of value uptil the limit . Keep prompting the user for a value...
-
The management of London Corporation is considering the purchase of a new machine costing $750,000. The company's desired rate of return is 6%. The present value factors for $1 at compound interest...
-
Accounting EMP CODE EMP_TITLE Mr. EMP_INITIAL w 1 1 2. 2 Ms. 3 3 Ms. R 4 4 Mrs. s L 5 5 Mr. 6 6 A Mr. Mr. 7 7 s 8 8 Ms. 1 9 9 Mr. w 10 1
-
The tractor is used to lift the 150-kg load B with the 24-mlong rope, boom, and pulley system. If the tractor travels to the right at a constant speed of 4 m/s, determine the tension in the rope when...
-
In the following C function, we have left the definition of operation 0P incomplete: A. What operation is 0P? B. Annotate the code to explain how it works. #define OP short arith (short x) { return x...
-
Function funct2 has the following prototype: double funct2(double w, int x, float y, long z); Gcc generates the following code for the function: 1 23 4 5 6 7 8 9 double funct2(double w, int x, float...
-
Write HCL code describing a circuit that for word inputs A, B, and C selects the median of the three values. That is, the output equals the word lying between the minimum and maximum of the three...
-
A positively charged particle creates the electric field shown in Figure 30. 20. When the kinks in the electric field lines reach the rod, what is the direction of the current induced in the rod?...
-
Suppose the current shown in Figure 30. 19 discharges the capacitor. What are the directions of \(\vec{E}\), \(\Delta \vec{E}\), and \(\vec{B}\) between the plates of the discharging capacitor? Data...
-
For the oscillating dipole of Figure 30. 14, sketch the electric field pattern at \(t=\frac{5}{4} T\). Data from Figure 30.14 0=1 t = T t=T 1=T O O D
Study smarter with the SolutionInn App