473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Printing a box of astrisks with a blank diamond

1
I am learning to program and I have a need for help to a problem I am sure most professional programmers can answer. I want to print a box of astrisks with a blanked out diamond shape in the center. I have the following code the will print the different sides, but unsure how to put them together to make the box. Any experienced people out there who would like to help me? Thanks.

Expand|Select|Wrap|Line Numbers
  1. Sub Main()
  2.  
  3.       'Print (a)
  4.       For i As Integer = 1 To 10
  5.  
  6.          For j As Integer = 1 To i
  7.             Console.Write("*")
  8.          Next
  9.          Console.WriteLine()
  10.       Next
  11.       Console.WriteLine()
  12.  
  13.       'Print (b)
  14.       For i As Integer = 10 To 1 Step -1
  15.          For j As Integer = i To 1 Step -1
  16.             Console.Write("*")
  17.          Next
  18.          Console.WriteLine()
  19.       Next
  20.       Console.WriteLine()
  21.  
  22.       'Print (c)
  23.       For i As Integer = 1 To 10
  24.  
  25.          ' print spaces
  26.          For j As Integer = 2 To i
  27.             Console.Write(" ")
  28.  
  29.          Next
  30.  
  31.          'Print astrisisks
  32.          For k As Integer = i To 10
  33.             Console.Write("*")
  34.          Next
  35.          Console.WriteLine()
  36.  
  37.       Next
  38.       Console.WriteLine()
  39.  
  40.       'print (d)
  41.       For i As Integer = 1 To 10
  42.          'print spaces
  43.          For j As Integer = i To 9
  44.             Console.Write(" ")
  45.          Next
  46.  
  47.          'print asterisisks
  48.          For k As Integer = 1 To i
  49.             Console.Write("*")
  50.          Next
  51.          Console.WriteLine()
  52.  
  53.       Next
  54.    End Sub
  55.  
  56. End Module
May 25 '07 #1
0 1049

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
5
by: Mr. B | last post by:
This is driving me NUTZ!!! I've been screwing around on this for a week now. And I have tried to find examples similar to what I have (nada). Got lots of streaming a TXT file... bah! I am...
11
by: coinjo | last post by:
I need to write a program which takes a number as an input and prints a diamond of # and $. The number of rows in the shape is equal to the number entered by the user. My program should display the...
0
by: brettk | last post by:
Thanks to Bob's help, I was able to get .tif printing working. Now i've got a new problem; if the image is more than one page, it only prints the first page. Here's my code: ...
0
by: John Smith | last post by:
Hello, I have 7 different crystal reports that need to be collated. Since I want to end up with a page of each (which all together make a single report), I created a blank main report and then...
0
by: bijon | last post by:
I have two tables. The ITEM RECD table containing the fields -- recd_invoice_ no, invoice_date,part_no,qty. The ITEM ISSUE table containing fields- issue_no, date, part_no,qty. The two tables are...
9
by: weird0 | last post by:
How does C++ and C# solve the Diamond problem? With the help of interfaces that is. Can anyone elaborate ....... Regards
14
by: Ken | last post by:
Using mail($addr , $subject, $body); When the email is printed, numerous blank pages print. Also the email has many blank lines under the content. How do I limit the email to content only? ...
0
by: gnewsgroup | last post by:
In my asp.net 2.0 web application. I create chart images on the fly by getting the data from the database. These chart images all have fixed width, but the height is dynamic depending on the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.