prog2 - CSE 114 Spring 2011 Programming Assignment 2 (HW 2)...

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

View Full Document Right Arrow Icon
CSE 114 Spring 2011 Programming Assignment 2 (HW 2) Due Date: Submit before 5pm on Wed March 9, 2011. Late programs will not be accepted. Important: Write plenty of comments in your code. Some points are reserved for that. Also include your name, ID number ,Lab-section number ,and HW number in every file that you submit. This information should be right at the top. Again some points are reserved for this as well. Youare sup- posed to use UNIX environment for this assignment. You may use anysinc-site or connect to sparky from your PC. There are twoseparate parts to this HW .You are supposed to hand in twoJav a pro- grams from your sparkyaccount. Createasubmit directory in your hw2 folder .You must submit both programs at the same time by executing command handin114 hw2 submit Note: handin114 command will be activated on Friday March 4, 2011 at 4pm. Also do not submit hw1 when we are expecting hw2. Grading: No credit if your program does not evencompile. If you are not able to do both programs, handin whateverprogram you have toget partial credit. If your programs work on some cases, then you should hand in both programs to get some credit for parts that work. Part I: Forthis part write a program called for playing a betting game. EE stands for Equal or Even. It involves rolling a pair of dice. Every time user wants to roll/throwdice, he/she must bet $1.00. If both dice showthe same number ,then user wins 3 dollars. If the sum of die-spots is just an ev en number (equals not included), user wins 50 cents. If the sum is odd user loses the bet. Generating Random Numbers: In this program, you need to generate tworandom numbers (for twodice), every time the game is played. These must be in the range 1 - 6, both included. Calling the Math.random( ) method returns a newrandom number of type double from 0.0 to, but
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/29/2011 for the course CSE 114 taught by Professor Tashbook during the Spring '08 term at SUNY Stony Brook.

Page1 / 5

prog2 - CSE 114 Spring 2011 Programming Assignment 2 (HW 2)...

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

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