Peegee
11-02-2004, 10:31 AM
There's a programming assignment I have to do, but I don't understand what it's asking me to do. I don't need help coding, just to be told what it expects me to do in order to receive input. Actually I'm just looking to verify what I think:
You are required to write two C programs using top-down design approach (that is, using functions as specified in the given structure chart) for the problem described below. The requirements of the two programs are as follows:
1) The first program should not use any global variables, must pass all input parameters using call-by-value parameters and must pass all output parameters using call-by-reference parameters.
2) The second program should declare all main program input and output variables globally and should not pass any parameters in the function calls. Note that a function can still declare needed local variables.
3) You are also required to show tracing of your two programs with test data to test for correctness of your solutions. Do not give other problem solving steps.
Problem Description:
In course 60-140 offered at the University of Windsor, your instructor evaluates student performance based on 6 assignments, 2 quizzes, a lab exercise mark, a lab exam mark, a class participation mark, a midterm test and a final examination mark.
As shown in the course outline for the course, the total course mark of 100% is distributed as follows:
COURSE EVALUATION
<table><tr><td rowspan="2">Work Mark (out of 100%)</td></tr>
<tr><td>Assignments</td><td>10%</td></tr><tr>
<td>2 Quizzes</td><td>15%</td></tr><tr><td>Lab Exercises and Attendance</td><td>5%</td></tr><tr><td>Lab Examination</td><td>5%</td></tr><tr><td>Class Participation</td><td>5%</td></tr><tr><td>Midterm Test</td><td>15%</td></tr><tr><td>Final Examination</td><td>45%</td></tr></table>
--
Am I supposed to write two different programs using different means to pass variables? One using global variables and the other using call by value/call by reference input/output? How do I go about doing the second? If I use call by value, the function call will be functName (a,b,c);, but what happens to the output? Can I still use *a = grade * 0.1; or whatever?
You are required to write two C programs using top-down design approach (that is, using functions as specified in the given structure chart) for the problem described below. The requirements of the two programs are as follows:
1) The first program should not use any global variables, must pass all input parameters using call-by-value parameters and must pass all output parameters using call-by-reference parameters.
2) The second program should declare all main program input and output variables globally and should not pass any parameters in the function calls. Note that a function can still declare needed local variables.
3) You are also required to show tracing of your two programs with test data to test for correctness of your solutions. Do not give other problem solving steps.
Problem Description:
In course 60-140 offered at the University of Windsor, your instructor evaluates student performance based on 6 assignments, 2 quizzes, a lab exercise mark, a lab exam mark, a class participation mark, a midterm test and a final examination mark.
As shown in the course outline for the course, the total course mark of 100% is distributed as follows:
COURSE EVALUATION
<table><tr><td rowspan="2">Work Mark (out of 100%)</td></tr>
<tr><td>Assignments</td><td>10%</td></tr><tr>
<td>2 Quizzes</td><td>15%</td></tr><tr><td>Lab Exercises and Attendance</td><td>5%</td></tr><tr><td>Lab Examination</td><td>5%</td></tr><tr><td>Class Participation</td><td>5%</td></tr><tr><td>Midterm Test</td><td>15%</td></tr><tr><td>Final Examination</td><td>45%</td></tr></table>
--
Am I supposed to write two different programs using different means to pass variables? One using global variables and the other using call by value/call by reference input/output? How do I go about doing the second? If I use call by value, the function call will be functName (a,b,c);, but what happens to the output? Can I still use *a = grade * 0.1; or whatever?