Computer Science Homework Solutions
Problem
#108170

Visual Basic

I am having trouble creating a program in Visual Basic that prints the * in a diamond shape.  Do you have any suggestions?

This is what I have so far.  It is an un-proportioned diamond, I need a normal diamond.  What am I doing wrong?


Dim i As Integer
        Dim y As Integer
        Dim j As Integer

        For i = -9 To 9
            y = System.Math.Abs(i)
            y = (y * (-1)) + 10

            Console.WriteLine("")
            For j = 1 To y
                Console.Write("*")
            Next

            i += 1
        Next



Solution
What is this?
By OTA - Overall OTA Rating
Xiao Liu, MS - 4.7/5
Purchase Cost Now
$2.19 CAD (was ~$19.95)
Included in Download
  • Plain text response
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • Program Writing in Visual Basic - I am having trouble creating a program in Visual Basic that prints the * in a diamond shape. Do you have any suggestions? This is what I have so far. It is an un-proportioned diamond, I need a n ...
  • Java Integer - Write program segments that accomplish each of the following tasks: a) Calculate the integer part of the quotient when integer a is divided by integer b. b) Calculate the integer remainder when ...
  • Finishing the code for this SalesPersonDemo project - Need help finishing the code for this SalesPersonDemo project. This project has to be completed by tomorrow. This is a final project and I am totally lost as to how to code this properly. Attached is ...
  • Visual C++ Classes - Write a program that read in an integer. If the integer is a negative number, catch the exception and print an error message "Invalid Integer: value negative" and prompt the user for another number. ...
  • Menu Driven Program - Visual Basic - name and phone numbers should be read into the program in "memberphones.txt" and should be displayed in a listbox when the form is loaded to delete a person, they should be highlighted and the dele ...
Browse