• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Looping problem

 
Greenhorn
Posts: 19
Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, Im kinda stock with this problem. I was trying to create this output using for loop




I was just wondering how to do it in java using loop any help?

Best regards
 
Ranch Hand
Posts: 160
IntelliJ IDE VI Editor Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What have you tried? What happened? Please post your code.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you written some code already; where exactly did you get stuck with this? Please post your code and explain in detail what it is you don't understand.

Do you know how to use loops? This part of Oracle's Java Tutorials explains while, do-while and for loops: Control Flow Statements
 
Caleb Jhay
Greenhorn
Posts: 19
Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually Im trying the whole alphabet. So far i got "D" and doing the rest so i still have no code with x and z thanks

Riaan Nel wrote:What have you tried? What happened? Please post your code.

 
Caleb Jhay
Greenhorn
Posts: 19
Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
not yet thanks for the link

Jesper de Jong wrote:Have you written some code already; where exactly did you get stuck with this? Please post your code and explain in detail what it is you don't understand.

Do you know how to use loops? This part of Oracle's Java Tutorials explains while, do-while and for loops: Control Flow Statements

 
Marshal
Posts: 71739
312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is awkward to write code to produce patterns for all letters. It is a lot easier to write this sort of pattern, because it has a definite repeating structure:

*
**
***
****
*****
 
We don't have time to be charming! Quick, read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic