Spring 1996
Assignment 3, due Thursday February 8
These programs are to be electronically submitted by using the
submit program on csa. The code
you submit should
conform with the
program assignment guidelines.
- KP exercise 4 on page 167. Write two versions:
"a3p1a.c" using conditional statements, and "a3p1b.c" using a switch
statement. Use file redirection to read the input file.
- Write a function
int mySum(int n);
that sums the integers between n and 2 * n
(inclusive). Return the resulting integer value. Write two versions
of mySum: one in the file "a3p2a.c" using for
loops, and one in "a3p2b.c" using while loops.
- Write a subroutine
void myRoots(float a, float b, float
c);
that prints polynomial roots and messages as described
in KP exercise 23 on page
172.
- KP exercise 11 on page 213.
You will submit six files for this assignment: a3p1a.c, a3p1b.c,
a3p2a.c, a3p2b.c, a3p3.c, and a3p4.c.
Programming assignments are due before class on the
assignment due date.
Late assignments will be levied a late penalty of 10% per day. Late
assignments will only be accepted up to 4 days late.
Academic Honesty and Collaboration
It is reasonable to discuss with others possible general approaches to
problems. It is unreasonable to work together on a detailed solution,
to copy a solution, or to give away a solution. If your common
discussion can be detected by looking at the solutions, then there is
too much collaboration. Such instances of academic dishonesty will
result in a course grade of F or expulsion from Boston University.
Do not allow your work to be used by others:
- Set the permissions so that they are not readable by others.
- Do not recycle old printouts. Take them home to throw them out.
- Do not e-mail your solution to anyone.
Warning: If someone cheats by using your work, you will also be penalized
Page Created: Jan 15, 1995
Maintained by: Stan Sclaroff