Structures & File Directed IO:
1. Suppose there are 'n' students enrolled in a course. (n= user input)
i. Take all the students name and ids as input using structures, and sort
the info alphabetically by their names. Then print out the sorted info.
ii. In the structure used in i. , add a member that will take quiz marks of 3
quizzes. Find the average of these marks for each student. Add another
member called merit that will define each students position according to
their average marks, and then print the students name, id and merit
position from 1st to last.
iii. Do the same using files as input & output.
2. Use structures to define complex numbers, and take 2 complex numbers as
inputs and implement functions to calculate their addition, multiplication and
division.
3. Use structures to define a point in the Cartesian coordinate system.
Implement functions to calculate the distance between such two points. Now
take 4 points as input from the user and implement functions that check if
these 4 points constitute a rectangle, or a square.
4. Add N (User Input) lengths in feet & inches using structures.
5. Write a structure to store the name, account number and balance of
customers (more than 10) and store their information.
i. Implement a function to print out the names of all the customers with
balance under $100.
ii. Implement a function to add $100 to all the customers having balance
above $500, and then print their incremented balance.
6. Write a program to compare two dates entered by user. Make a structure
named Date to store the elements day, month and year to store the dates. If
the dates are equal, display "Dates are equal" otherwise display "Dates are
not equal".
7. Create a C program to read a day (suppose your birthday) from a file. Using
structures, calculate your age and store your age (Years, months, days) in
another file.
8. Create a C program that generates five random marks, stores them in a file,
reads the marks from the file, finds the lowest mark, and replaces it with "0"
9. Write a C program that can create a file as "Exercise.txt" which contains the
following sentence: “In our programming class, we save our files in .c format.“
The program then reads the sentence from the file and prints the sentence
replacing the .c with .py like this: “In our programming class, we save our files
in .py format.”
10. Write a c program to print the source code of the same program using File IO.