السلام عليكم
بليز اذا فيكم تساعدوني بحل هدول الاسئله لاني بصراحه مش فاهمي الستركر والكلاسز ومطلوب منا تسليم حلهم للدكتور انا حاولت احلهن بس ما قدرت اذا في حدى بيقدر يحلهم بليز يساعدني
ASS#2
Q1. Assume Time is a structure with three integer fields (hour, minute, and second). Assume ARY is an array of Time variables of length 20. Assume that PTR is a pointer that points to one of the elements in this array.
(a) Write a function that will input the values of hour, minute and second for each element in the array ARY.
(B) Write the necessary statement(s) that will print the hour, minute, and second of the element at which PTR points.
© Write a function that find the minimum time in the array. The minimum time should be printed in the main function.
Q2. Write a student structure with array of 5 marks and the average.
1- Write a function to fill the marks for an object of this structure.
2- Write a function to calculate the average of the object.
3- Define a pointer that points to student object and print out the data of the object using its pointer.
4- Define array ARR of 10 objects. Write a function to fill this array.
5- Assume the pointer PTR points to the second element of the array ARR. Use this pointer to print out the data where it is pointed at.
6- Write a function to find the maximum mark in the array ARR. Print the index of the object that has the max mark in the main function.
Q3. Write a structure of a file contains the following attributes
- Size as integer
- Ctime (creation time) as time object (in Q1).
1. Create an object of file structure. Write a function to fill this object.
2. Create array of 10 object files. Write a function to fill this array.
3. Write a function to swap the last object with the first object in the array.
4. Write a function that find the size of the last file that was created in the array.
5. Write a function that find the created hour of the smallest file size.
*6. Write a function that print out the files information in the array from the newest to the oldest.
Note: computer file (word document, text …etc) not acceptable. The assignment should be written by hand.