

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The instructions for homework 2 in the enee 114: programming concepts for engineers course at the university of maryland. The assignment covers compound conditional statements, loops, arrays, and text strings in c programming. Students are required to write programs to meet specifications and submit both the c program and a log file.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


% script hw2pq.log Script started. File is hw2pq.log % whoami;date [username and date printed here] % gcc -Wall -o hw2pq hw2pq.c % hw2pq Enter P and Q: 3 20 ...[output of your program goes here] % hw2pq Enter P and Q: 15 10 ...[output of your program goes here] % hw2pq Enter P and Q: 15 10 ...[output of your program goes here] % exit Script done, file is hw2pq.log
Question 2
Design and implement a program hw2gr.c that will let you input student scores on an exam, edit the list of scores,
then calculate and print the maximum, minium, mean and average score for the exam along with the entire exam record.
The user interface for this program is as follows: when the program prints the prompt ‘Action:’, the user responds
with one of the following single-letter (plus arguments, in some cases) commands:
You must compile your program with all warnings enabled (use the –Wall option), and electronically submit both
the C program and a log which shows the program compilation and execution.
To create the log, do the following once your program is working and you are ready to submit: % script hw2gr.log Script started. File is hw2gr.log % whoami;date [username and date printed here] % gcc –Wall -o hw2gr hw2gr.c % hw2gr [user ‘hello’ and help instructions ouput displayed here] Action: a Donald Duck 34 Action: a Minnie Mouse 88 Action: l 1 Duck, Donald, 34 2 Mouse, Minnie, 88 Action: q % exit Script done, file is hw2gr.log
Hint: You will need to use all of the following for this question: arrays, text strings, loops, if-then statements.