BU CAS CS 113
Introduction to Computer Science II with Intensive C

Spring 1996

Assignment 5, due Thursday February 22


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.
  1. KP exercise 11 on page 395.

  2. KP exercise 12 on page 395.

  3. KP exercise 20 on page 397.

    In addition, use your multiply and addition functions in a main program that takes input from the command line of the form:

    program real_or_complex_number op real_or_complex_number

    You can assume that complex numbers will be of the form {number}+i{number} (without spaces), and reals are the usual floating point numbers.

    Here are some examples of valid input:

    	myprogram 4.4+i6.6 plus 4.0

    myprogram 5.0 times 4.4-i0.1

    myprogram 4.4+i2.3 plus 0.0-i4.0

    myprogram 4 plus 6.7

    Your program should print out the result as a complex number or a real depending on the type.

You will submit three files for this assignment: a5p1.c, a5p2.c, a5p3.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:

Warning: If someone cheats by using your work, you will also be penalized


Page Created: Feb 6, 1995 Maintained by: Stan Sclaroff