
Java - drawing geometric shapes with stars '*'
- or -
Post a project like this2116
€20(approx. $23)
- Posted:
- Proposals: 4
- Remote
- #2634149
- Awarded
Description
Experience Level: Entry
Hey,
need Java source codes to draw this geometric shapes (10 total, marked in the pictures) with for loops
https://imgur.com/a/1HKLwcO
width/height exactly as pictured
for example nr 28
##########################################################
package com.company;
public class Main {
public static void main(String[] args)
{
int n=8;
int a;
int b;
//oben
for (int i=0; i<=n; i++)
{
for (a=0; a<(n-i); a++)
{
System.out.print(" ");
}
for (b=0; b0; a--)
{
System.out.print(" ");
}
for (b=0; b<i; b++)
{
if(b==0 || b == i-1)
System.out.print("* ");
else
System.out.print(" ");
}
System.out.println();
}
}
}
##########################################################
need Java source codes to draw this geometric shapes (10 total, marked in the pictures) with for loops
https://imgur.com/a/1HKLwcO
width/height exactly as pictured
for example nr 28
##########################################################
package com.company;
public class Main {
public static void main(String[] args)
{
int n=8;
int a;
int b;
//oben
for (int i=0; i<=n; i++)
{
for (a=0; a<(n-i); a++)
{
System.out.print(" ");
}
for (b=0; b0; a--)
{
System.out.print(" ");
}
for (b=0; b<i; b++)
{
if(b==0 || b == i-1)
System.out.print("* ");
else
System.out.print(" ");
}
System.out.println();
}
}
}
##########################################################

Lukas M.
100% (2)Projects Completed
1
Freelancers worked with
2
Projects awarded
100%
Last project
10 Dec 2019
Austria
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies