Solved

Shapes In Eiffel

Posted on 2003-11-16
2
1,407 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
Comment Utility
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
Comment Utility
A BIG BIG THX!!!!!

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

thx again
!!


0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now