Documente Academic
Documente Profesional
Documente Cultură
Structure
Question 1
(b) Declare a variable textbook of (type) structure book and assign the following information
into the variable from the standard input.
ID: 1234
Title: Problem Solving and Programming
Publisher: Prentice Hall
Unit price: 44.50
(c) Write appropriate program that prints back all the information entered.
Question 2
By making use of the structure defined in (a) above, write a program that reads id, title, publisher
and unit price for at least 5 books and store them into an array of structure book called
storybook.
Question 3
An instructor needs a program that reads marks for each student for a particular subject. The
marks are from three projects, two tests and one final exam, which are stored as elements of
structure student. The program then computes the project marks average, the test marks
average, and the final exam mark, and multiply them with their respective weight as shown in
Table 1 below.
Table 1
Assessment Weight
Project 1
Project 2 30%
Project 3
Test 1
20%
Test 2
Final examination 50%
Total 100%
Finally, the program should calculate the total mark for each student and determine his grade
for the subject based on the following grading scheme.
By HA 2013 1