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 1:52

I won't help you with your HOMEWORK until you:
  • Figure out how to indent
  • Use code tags so it's actually readable
  • Figure out how to indent your code
  • Use some language that doesn't suck, like Scheme
  • Actually try to do it yourself
  • Figure out how to indent your goddamn code

Name: Anonymous 2010-03-19 3:47

>>2
I love you.

Name: Anonymous 2010-03-19 6:19

[quote]Use some language that doesn't suck, like Scheme[/quote]

murrharrharrarararharr

Name: Anonymous 2010-03-19 9:02

>>2
You mad because there are no question about your stupid motherfucking fuck language with zero.zero potention? Fuck you. And fuck you too if you post another no-C-framework-to-troll-this-thread. Seriously, you guys need some discipline here. I remember the days when /prog/ was actually a good place to ask such questions. You motherfuckers ruined it by doing this. Ugh. And no, I'm not mad.

Name: not >>2 2010-03-19 9:05

>>5
And when was that? It sure wasn't in the past 2 years and since you are likely OP, you're probably just some kid that just started learning Java and needs help with his homework.

I think >>2's guidelines are excellent if you're willing to ask for help on /prog/ as we usually help when the OP uses proper tags, indentation and a language we prefer writing code in.

Name: Anonymous 2010-03-19 9:06

>>3
Seriously, you guys need some discipline here.
I agree. Discipline like being banned for not seeing anything wrong with lack of code tags and indentation.

Name: Anonymous 2010-03-19 10:09

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

Your flow control is shit. Learn to flip burgers retard.

Name: Anonymous 2010-03-19 10:21

Name: Anonymous 2010-03-19 10:45

>>9
usingsuckmydick

Name: Anonymous 2010-03-19 10:52

>>10
Back to /b/ please

Name: Anonymous 2010-03-19 10:53

>>3
i dont

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''.

Name: Anonymous 2010-03-19 14:06

>>13HBT, but has a point nonetheless.

Name: Anonymous 2010-03-19 20:29

>>5

Look up the archive, /prog/ was never a place where you could ask homework questions and not have someone insult you. Try /pr/ instead... They're happy with homework questions.

public static void main(String [] argv)
{
    if (argv.length >= 2)
    {
        try
        {
            int a = Integer.parseInt(argv[0]);
            int b = Integer.parseInt(argv[1]);

            for (int c = 0; c < b; ++c) {
                System.out.println(a);
            }
        }
        catch (Exception e)
        {
            System.out.println("Invalid arguments, " + e);
        }
    }
    else
    {
        System.out.println("Insufficent arguments");
    }
}

Name: Anonymous 2010-03-19 21:39

DON'T HELP HIM!!

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