Professional Documents
Culture Documents
Technology
BIC10404:
Struktur Data/
Data Structure
start
Alia Burn Muthu Chun
NULL
1530.20 6970.50 4905.00 3280.40
2. Write a program that allow user to input 5 records into a linked list. Each record contains
students’ name and test marks. This program also contains of:
a) display all the records in the linked list
puts(curr->name);
printf(“%.2f”, curr->marks);
curr = curr->next;
}
b) display all the students’ name whose test mark is less than 50.
void printFail(record * head) {
puts(curr->name);
curr = curr->next;
min = curr->marks;
stdName = curr->name;
curr = curr->next;
}
(ii) A function called maxMarks to display the student’s name with maximum
mark
max = curr->marks;
stdName = curr->name;
curr = curr->next;
float avg = 0;
avg += curr->marks
curr = curr->next;
avg /= 5;
}
3. Table 1 shows classification of blood pressure based on the systolic blood pressure (SBP)
and diastolic blood pressure (DBP) level and recommendations for follow up defined by
The Seventh Report of the Joint National Committee on Prevention, Detection,
Evaluation and Treatment of High Blood Pressure.
Table 1: Classification of blood pressure and recommendations for follow up based
on initial blood pressure measurements for adults.
Based on Table 1, write a program that allows the user to input records into a linked list.
The total of the records are determined by the user. Each record contains name of patient,
age, SBP, DBP and blood pressure category. The blood pressure category is determined
by the SBP and DBP. In this program display:
a) all the patients’ information
b) the total and all the patients’ name whose in the Hypertensive Crisis category.
c) the total and all the patients’ name whose in the Normal category.
CODING
OUTPUT