CSE 1311 - Section 2 - Assignments - Assignment 5

Due date: Wednesday, March 3, 2010, 11:55pm.


Task 1 (20 points)

Write a program called task1.c or task1.cpp, that behaves as follows: For full credit, you should implement a function int * make_descending(int A, int B), that creates and returns an array of integers containing, in DESCENDING order, all integers between A and B. Solutions not implementing this function will get at most half credit.


Task 2 (20 points)

Write a program called task2.c or task2.cpp, that behaves as follows: For full credit, you should implement a function ... compute_average(double * numbers, ...), that computes the average of all values stored in the array numbers. You have to figure out the return type for this function (intentionally left unspecified), and whether you need to pass any additional argument or arguments and the type of those arguments. Solutions not implementing this function will get at most half credit.


Task 3 (20 points)

Write a program, in a file called task3.c or task3.cpp, that:

For full credit, you should implement a function ... count_odds(int A, int B), that computes and returns the number of odd numbers between A and B(including A and B). You need to figure out the return type for that function. Solutions not implementing this function will get at most half credit.


Task 4 (20 points)

Write a program, in a file called task4.c or task4.cpp, that:

For full credit, you should implement a function ... compute_result(int A), that computes and returns A * (A - 0.5) * (A + 0.5). You need to figure out the return type for that function. Solutions not implementing this function will get at most half credit.


Task 5 (20 points)

Write a program, in a file called task5.c or task5.cpp, that:

For full credit, you should implement a function ... compute_product(int A, int B), that computes and returns product of all integers between A and B (including A and B). You need to figure out the return type for that function. Solutions not implementing this function will get at most half credit.


How to submit

Submisions are only accepted via WebCT. The submission should include your C or C++ source files, and answers.doc. Do not submit entire project directories, or anything else except for the .c and .cpp files and the answers.doc file.

Your answers.doc file should be a single Microsoft Word file that includes:

Make sure that your answers.doc file is easy to parse, and that it is easy for us to figure out which part corresponds to which task. Feel free to use headings such as "start of copy of task1.c".

We try to automate the grading process as much as possible. Not complying precisely with instructions causes a significant waste of time during grading, and thus points will be taken off for failure to comply, and/or you may receive a request to resubmit.

Submission checklist