exerciseFeb1308

exerciseFeb1308 - COMP202 Instructor: Ladan Mahabadi...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
COMP202 Instructor: Ladan Mahabadi February 13, 2008 Oblivious Prisoner’s Dilemma: Two accomplices are arrested. Due to insufficient evidence for a conviction, the police offer each prisoner a choice. If one testifies against the other, then the other will get sentenced to 10 years (and the betrayer will go free). If they both remain silent, they will both be sentenced to two years and if they both confess, then they will both receive a five-year sentence. Write a program that presents the user with two choices (Confess or not) and randomly generates the choice of the other prisoner (i.e. indicating whether or not he confesses) and then announce the sentence.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Clum Z. University: A fictitious university hires you to implement a program storing information about their students. Since the program is in its initial stages, you only have to represent each student with their name and a randomly assigned 8-digit student number that starts with 2007. Complete the following implementation: Import java.util.*;
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

exerciseFeb1308 - COMP202 Instructor: Ladan Mahabadi...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online