CSCE 1040 HW 4: Recursive Solution for Robbers Problem - Prof. Ryan M. Garlick, Assignments of Computer Science

Instructions for completing homework assignment csce 1040 hw 4, which involves writing a recursive solution for the robbers problem. The function should take an integer input for the number of robbers and output a proposal. Details on how to turn in the assignment and grading criteria.

Typology: Assignments

Pre 2010

Uploaded on 08/19/2009

koofers-user-1lm
koofers-user-1lm 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSCE 1040 HW 4 Due: Wednesday, Feb. 25th @ midnight
Late Assignments will be printed out and folded into origami swans
Summary:
Write a recursive solution to the robbers homework (you saw this one coming). This program should
have a main method that calls robbers( ). robbers( ) must be a recursive function. The function should
take as input an integer n from 1 to 20 for the number of robbers – this may or may not be the only
parameter to robbers( ). The output of the program should be the proposal by n. For example, given n =
2, the program should output 100 0. You may do the output in main to make your robbers function
shorter (this may also require a loop in main, which is fine).
Your class name (and file name) should be your last name.
A recursive solution could call itself to find the full solution with fewer robbers, or could call itself to find
the number of bonds that a less senior robber is getting (for a given number of robbers).
Turn-In:
Please e-mail your source code (lastname.java) to [email protected] with the subject CSCI 1040
Homework 4 – your_last_name. I may miss your assignment if you turn it in with a different subject.
Please try to have a final version ready before turning in – it is harder to keep up with several versions of
your program.
Grading:
The author of the solution that uses the fewest number of characters of source code will receive 5 points
on the last exam, a UNT towel, and a congratulatory handshake. I would recommend getting a working
version, and then trying to compress it.
if you can read this you don’t need glasses

Partial preview of the text

Download CSCE 1040 HW 4: Recursive Solution for Robbers Problem - Prof. Ryan M. Garlick and more Assignments Computer Science in PDF only on Docsity!

CSCE 1040 HW 4 Due: Wednesday, Feb. 25th^ @ midnight

Late Assignments will be printed out and folded into origami swans

Summary: Write a recursive solution to the robbers homework (you saw this one coming). This program should have a main method that calls robbers( ). robbers( ) must be a recursive function. The function should take as input an integer n from 1 to 20 for the number of robbers – this may or may not be the only parameter to robbers( ). The output of the program should be the proposal by n. For example, given n = 2, the program should output 100 0. You may do the output in main to make your robbers function shorter (this may also require a loop in main, which is fine). Your class name (and file name) should be your last name. A recursive solution could call itself to find the full solution with fewer robbers, or could call itself to find the number of bonds that a less senior robber is getting (for a given number of robbers). Turn-In: Please e-mail your source code (lastname.java) to [email protected] with the subject CSCI 1040 Homework 4 – your_last_name. I may miss your assignment if you turn it in with a different subject. Please try to have a final version ready before turning in – it is harder to keep up with several versions of your program. Grading: The author of the solution that uses the fewest number of characters of source code will receive 5 points on the last exam, a UNT towel, and a congratulatory handshake. I would recommend getting a working version, and then trying to compress it. if you can read this you don’t need glasses