Results 1 to 2 of 2
Thread: completely new
- 08-05-2010, 07:30 PM #1Member
- Join Date
- Aug 2010
- Rep Power
i have 2 problems one im trying to make a array using data that has both letter and number ex. 12321sdsd < but i get errors how can i fix that?
question 2 is wher do i begin on this problem i need
You do not need to use any keyboard I/O. Each time the code is ran, I will change the value of play to test your code. You do not need to use the keyboard.class as stated in the textbook.
If you want to use some of the example code above (How to get user input) to add keyboard input for this assignment that is fine but not required.
When play = 1 draw one blue circle on the right and display the following text below the circle on the left hand side:
"If all our misfortunes were laid in one common heap, whence everyone must take an equal portion, most people would be content to take their own and depart."
When play = 2 draw two green box's 40 pixels wide on the right and display the following text below the box's on the left hand side:
"There are only two ways to live your life. One is as though nothing is a miracle. The other is as though everything is a miracle."
-- Albert Einstein
When play = 3 draw three gray lines 70 pixels long on the right and display the following text below the lines on the left hand side:
"We are like butterflies who flutter for a day and think it's forever."
When the value of play is <= 100 but not 1, 2, or 3 display the following text on the left hand side:
"I haven't failed, I've found 10,000 ways that don't work."
When the value of play is > 100 and <= 1000 display the following text on the left hand side:
"Any science or technology which is sufficiently advanced is indistinguishable from magic."
--Arthur C. Clarke
When the value of play is >1000 display the following text on the left hand side:
Sorry, Value is out of Range!
- 08-05-2010, 07:43 PM #2
If there are errors in your existing code, you need to post both the code and the exact error messages. My guess is, though, that you did not wrap it in quotes. (That is, 123abc is different from "123abc".)
For the second problem, it will be a series of if statements that detects the value of some variable play and then uses System.out.println() for the different lines depending on the value.
- By nickvandewiele in forum New To JavaReplies: 1Last Post: 03-26-2010, 02:08 PM
- By venkateshk in forum New To JavaReplies: 2Last Post: 11-17-2008, 10:17 AM
- By Seamo14 in forum New To JavaReplies: 4Last Post: 10-09-2008, 12:50 PM
- By amamare in forum Advanced JavaReplies: 0Last Post: 12-19-2007, 03:12 PM
- By jpnym15 in forum New To JavaReplies: 2Last Post: 11-14-2007, 07:40 PM