No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
7 Posted Topics
hi all, been tryin to find wat is wrong with this code. It works for sometime then starts repeating the same value continuossssssly. any help will be appreciated. thanks /* THIS PROGRAM IS TO RUN A SIMULATION PROGRAM OF ARRIVAL AND SERVICE TIMES OF AN AUTO-REPAIR WORKSHOP * servTime = …
try this i'm learning too: pass in each score into this: public changeToLetter(int score){ for (int i=0; i <= score.length; i++){ if (score[i] >= 90){ string gradeLetter = "A"; return gradeLetter;} else if(score[i] >= 80){ string gradeLetter = "B";} .....on and on } } Goodluck
string.indexOf(letter) checks for the first occurence. what can check for all occurences public class Hangman extends ConsoleProgram { private static final int MAX_NUMBER = 9; private RandomGenerator rgen = new RandomGenerator(); HangmanLexicon lexicon = new HangmanLexicon (); private static boolean end; private HangmanCanvas canvas; private static int x = 30; …
import acm.graphics.*; import acm.program.*; public class BlacknWhite extends GraphicsProgram { public void run(){ GImage image = new GImage ("akinfemi.jpg"); GImage grayImage = createGrayScaleImage(image); add(image, 10, 50); add(grayImage, 100, 50); } private GImage createGrayScaleImage(GImage image){ int [][] array = image.getPixelArray(); int height = array.length; int width = array[0].length; for (int i …
public class Strength3 extends ConsoleProgram { private static String[] blank; private static String it; public void run(){ blank = new String[5]; for (int i=0; i<5;i++){ blank[i] = "-"; it+=blank[i]; } println(it); } } why does it print 'null' first. all i want is just 5 hyphens...thanks
pls my eclipse galileo int r = GImage.getRed(pixel); int g = GImage.getGreen(pixel); int b = GImage.getBlue(pixel); also int [][] array = image.getPixelArray(); as an error like its not in the library... anyone pls
Hi, name's akinfemi, Student of Industrial Engineering... I'm a bit new to Java so i'll be welcoming any help from anyone to expand my knowledge... Thanks
The End.
akinfemi