Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C programming: files, structures Aim: To demonstrate your knowledge in using handling FILES in C Programs Title: C Program to Read & Write data into

C programming: files, structures

image text in transcribed

image text in transcribed

Aim: To demonstrate your knowledge in using handling FILES in C Programs Title: C Program to Read & Write data into a data file In this lab you will write a program for reading information from a data file and saves a summary report into another data file. The summary report will include the average, the maximum, and the minimum value. A data file named 'speed.txt' contains several speed readings, the first record in the speed data file contains an integer that specifies the number of records that follow. Each of the following lines contains a time and speed reading 0.0 0.1 0.2 0.3 0.4 0.5 132.5 147.2 148.3 157.3 163.2 158.2 169.3 148.2 137.6 135.9 0.6 0.7 0.8 0.9 The output of the problems should be saved into another data file, named 'Output.txt'. With the following data: Number of sensor readings: 10 Average reading: 149.77 Maximum reading: 169.30 Minimum reading: 132.5 12.2 Aim: To demonstrate your knowledge in using nested structures with dynamic memory allocation Title: C Program to Store Information of Students Using Structure This is an extension to the task 10.1 from week 10. Rewrite the implementation of the nested structures based on the following instructions: 1. The program should be capable of storing any number of students 2. Program to allow each student to register for a minimum of one (1) subject and a maximum of four (4) subjects Use the following subject & student structure as a guide for your implementation typedef struct char ID[10]: I/subject ID char name[10]; //subject name COS10008 - Foundations of Technical Programming NE float marks; /subject marks }unit_template; type struct char ID[10]: I/student ID char name[10]; //student name int count; //subject count unit_template "unit; Ilpointer to store the memory address where the student's unit details are stored }student; Sample data: Details for 3 students Student-1 ID-10011 Name - John Count - 3 Unit -7623AB (Address) Student-2 ID-10012 Name - Peter Count-1 Unit - 1432AC Student-3 ID-10013 Name - Helen Count - 2 Unit - 9872AD Diagrammatic representation of the above sample data ID-10011 Name - John Count - 3 Unit - 7623AB ID-10011 Name - John Count - 1 Unit - 1432AC ID-10011 Name - John Count -2 Unit - 9872AD 9872AD ID-S100B ID - 51001 Nam-C Program Marks -98 Marks - 55 7623AB ID-1001 ID-S1008 ID-S1004 Name - Database Marks - 57 Marks - Marks - 76 1432AC ID-S1001 Marks - 88

Step by Step Solution

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

More Books

Students also viewed these Databases questions

Question

Assess three steps in the selection process.

Answered: 1 week ago

Question

Identify the steps in job analysis.

Answered: 1 week ago