Jump to content

Help with Java :(

- - - - -

  • Please log in to reply
4 replies to this topic

#1
xxDiamondArcadexx

xxDiamondArcadexx

    Newbie

  • Members
  • Pip
  • 1 posts
Hey Guys,

I have a small problem with my Java programming for college. I have been asked to write a programme in basic java using nested for loops
which will print out the following shape :
++++
+++
++
+

I don't really know how to go about it, so any help would be much appreciated :)

Alicia
XOXOXOXO

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Step 1: write the skeleton of a program with a nested for loop.

Hint: row 1 has 5-1 +'s, row 2 has 5-2 +'s, row 3 has 5-3 +'s, and row 4 has 5-4 +'s.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Sinipull

Sinipull

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 386 posts

Quote

Alicia
XOXOXOXO

Posted Image

Not that it matters, but still...

Outer nested loop should print the newline character, inner one should print the pluses

#4
lethalwire

lethalwire

    while(false){ ... }

  • Members
  • PipPipPipPipPipPipPip
  • 748 posts
  • Programming Language:Java, PHP
  • Learning:Java, PHP

Sinipull said:

Posted Image

Not that it matters, but still...

Outer nested loop should print the newline character, inner one should print the pluses

lol :D :love::love::love:

#5
zapdude1234

zapdude1234

    Learning Programmer

  • Members
  • PipPipPip
  • 31 posts
hint: you dont have to add to an integer for the for loop you can minus by --i.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users