Ask Experts Questions for FREE Help !
Ask
    Simonne's Avatar
    Simonne Posts: 7, Reputation: 1
    New Member
     
    #1

    Oct 22, 2009, 03:10 PM
    Qbasic programing
    Please help me I have no idea how to program this thing!


    Develop a program using loops that displays rows of asterisks in two different ways:
    1. Ascending then Descending

    *
    **
    ***
    ****
    *****
    ******
    *******
    ********
    *********
    ********
    *******
    ******
    *****
    ****
    ***
    **
    *
    2. Descending then Ascending

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

    The maximum number of asterisks in any row is 9.
    The program should prompt the user as to which of the above
    Display methods should be used.

    Hint: Use nested loops.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #2

    Oct 22, 2009, 03:32 PM

    QBasic.com
    Perito's Avatar
    Perito Posts: 3,139, Reputation: 150
    Ultra Member
     
    #3

    Oct 23, 2009, 02:23 PM
    Ascending then Descending:

    For I = 1 to 9
    for j = 1 to I
    Print "*"; ' the semi-colon prevents a new line from being written
    next j
    print ' gets a new line
    next I
    for I = 8 to 1 step -1 ' I'm not sure this is QuickBasic's syntax, but there is something.
    for j = 1 to I
    print "*"; ' the semicolon prevents a new line from being written.
    next j
    print ' gets a new line.
    next I

    Descending then ascending is very similar.

    There are many other ways to program this also -- some simpler than others.
    Simonne's Avatar
    Simonne Posts: 7, Reputation: 1
    New Member
     
    #4

    Oct 26, 2009, 07:50 AM

    Thank you very much for your help, I will try it out and see what I get.
    Thanks
    Simonne's Avatar
    Simonne Posts: 7, Reputation: 1
    New Member
     
    #5

    Nov 10, 2009, 09:10 AM

    Thank you that really did help.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Themostat programing [ 2 Answers ]

I do not know how to program my thermostat, it is a honeywell 7 day progarmer. The temperature stays at 83 and refuses to go down, it is hot and I do not know what to do. Please can some one respond and Help me

QBASIC programming [ 1 Answers ]

Tell me how to do programming in qbasic

Programing [ 2 Answers ]

Hey Could someone please give me a name of a site that explains in depthly how to make your own computer program on windows me or could some very nice person explain it to me in extrem depth how to make your own program? Much apperciated

Regarding JSP programing [ 1 Answers ]

Sir,I have written one program in jsp for userlogin and password checking.It makes msaccess connectivity. It also extracts the data.But what ever the in the database,it is extracting. But I am going to give the username and password from outside,it should give username and password is not valid....

Running QBasic in Suse 10 (Linux) [ 11 Answers ]

Background: I have this QBasic program, consisting of these 3 files (QBASIC.EXE, QBASIC.HLP, QBASIC.INI), and it’s currently running on Windows XP SP2 OS. I plan to switch an entire lab to SUSE 10 Linux OS. I have a beginning programming class (senior high) that’s learning this old language. ...


View more questions Search