![]() |
|
#1
|
||||
|
||||
Need help on a program for schoolHello thank you in advance to anyone who can help me!
Here is the assignment: "Write a program that uses for statements to print the following patterns seperately, one below the other. Use for loops to generate the patterns. All asterisks (*) should be printed by a single statement of the form cout << '*'; (this causes the asterisks to print side by side.) [Hint: The last two patterns require that each line begin with an appropriate number of blanks.] CPP / C++ / C Code:
Edit:Ohh by the way im using Microsoft Visual C++ 6.0. |
||||
|
#2
|
|||
|
|||
Re: Need help on a program for schoolQuote:
So here is a hint. Given that the patterns provided show various ascending & descending patterns, you may want to experiment with various ascending & descending for-loops. If you have a specific question about syntax or are unclear about particular concepts, post what code you have completed to establish a basis for further discussion. |
|
#3
|
||||
|
||||
Re: Need help on a program for schoolHi,
The thing is i have no idea how to even start writing this program. I know this is a forum to help me help myself but i have no idea where to start. I just started programming in c++ this summer and have only written a couple of simple programs. So if you can help me it would be very useful for me. Thank you!! |
|
#4
|
|||
|
|||
Re: Need help on a program for schoolQuote:
We will use that as the basis for further discussion. |
|
#5
|
||||
|
||||
Re: Need help on a program for schoolHere is the program printing "abc" as you asked for:
CPP / C++ / C Code:
CPP / C++ / C Code:
|
|
#6
|
|||
|
|||
Re: Need help on a program for schoolQuote:
|
|
#7
|
||||
|
||||
Re: Need help on a program for schoolAlright
Quote:
Quote:
|
|
#8
|
|||
|
|||
Re: Need help on a program for schoolQuote:
Quote:
|
|
#9
|
||||
|
||||
Re: Need help on a program for schooli kinda dont understand what to do. But this is what i tried to do from what you said and i don't think its what you want me to do.
CPP / C++ / C Code:
|
|
#10
|
|||
|
|||
Re: Need help on a program for schoolQuote:
The inner for-loop is doing just as you prescribed. Note that the test condition linenum!=0 is checked after incrementing is done. Therefore linenum is always not equal to zero. The body of the inner for-loop is never executed. Note also that your outer for-loop begins at 0 & continues until counter <= 10. In other words, you will be displaying 11 lines. C++ (as is C...) are predicated on 0-based counting. Get used to the following as counting up to ten: CPP / C++ / C Code:
|
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Equation solver | RazoR | C Programming Language | 3 | 18-May-2008 10:24 |
| Two-Tier data dissemination code installation problem | nidhibansal1984 | Computer Software Forum - Linux | 6 | 16-Sep-2007 11:13 |
| BOOKEEPING program, HELP!! | yabud | C Programming Language | 10 | 17-Nov-2006 04:48 |
| Help with a complex program | lordfuoco | C++ Forum | 5 | 24-Jun-2006 07:03 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The