Solved

Shapes In Eiffel

Posted on 2003-11-16
2
1,411 Views
Last Modified: 2013-12-03
hello,

i have to create a program to Eiffel that ask the user to enter for an odd  integer and
then create a  rhombus shape using * (with out any libraries ) and using onlly loop + if commands

like that

if number is 3

   *
 ***
   *

if the number is 5

    *
  ***
*****
  ***
    *

if the number is 7

       *
     ***
   *****
 *******
    *****
      ***
        *

and so on....

can you help me pls

0
Comment
Question by:superap
2 Comments
 
LVL 1

Accepted Solution

by:
bearware earned 250 total points
ID: 9831963
Sounds like homework. So here are some clues.

How many wide is each shape.
How high is each shape.

How does the number of stars change on each line (just do the top part first when its working add the bottom part)
How many spaces before the start. (do spaces as # get this working before adding stars, changes # to space when it all works)

Write a sceliton for the draw_rombus routine, write a requires clause for it. (answer is in the question)
In you class have a feature number_of_line_output : INTEGER
Write an ensure for draw_rombus that uses number_of_line_output
Write a feature that outputs one line. Write an ensures clause for that feature.

P.S. your question is not O.S. spacific

If you get stuck I may add more clues/
0
 

Author Comment

by:superap
ID: 9834517
A BIG BIG THX!!!!!

the phrase "How does the number of stars change on each line" is the solution!!!

thx again
!!


0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question