Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Anyone know a method to accomplish this?

Name: Anonymous 2010-03-19 1:28

Write a program that behaves as follows: a first integer value is input. if negative, program terminates, if not, second integer value is input, and the program repeatedly outputs that second value the number of times indicated by the first value. The process then repeats from the very start.

Format that output as follows: following every three values output, a blank displayed. (careful: the count does not reset between sets of outputs.


so far i made


import java.util.*;

class Assignment91
{
public static void main(String [] args)
{
Scanner keyboard = new Scanner(System.in);
int z=0;
while(z==0)
{    int i, b, a;
System.out.println("Please enter an integer, a negative integer will terminate program");
a = keyboard.nextInt();

if(a<0)
System.exit(1);

System.out.println("Please enter another integer");
b = keyboard.nextInt();

for(i=0; i<a; i++)
System.out.println(b);
}
}
}


thanks MIT  students!

Name: Anonymous 2010-03-19 12:54

>>5
I remember the days when /prog/ was actually a good place to ask such questions.
No you don't. You may remember a time when everyone did ask questions like this, three or four years ago, but that's not the same thing.

You motherfuckers ruined it by doing this.
I strongly disagree that the fact that people aren't putting up with bullshit homework questions where the poster doesn't even give a shit about the other people on /prog/ in any way constitutes ``ruining''.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List