Question: * *** ***** ******* ***** *** * Write a program that displays the followingpattern: Output . Seven lines of output as follows: The first consists

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

Write a program that displays the followingpattern:

Output . Seven lines of output as follows: The first consists of3 spaces followed by a star. The second line consists of 2 spacesfollowed by a 3 stars. The third consists of one space followed by5 stars, and the fourth consists just of 7 stars. The fifth line isidentical to third, th sixth to the second and the seventh to thefirst.

CLASS NAMES. Your program class should be called StarPattern

I NEED iIT TONIGHT! IT MUS TBE In JAVA PROGRAMMING......I triedbut getting a lot of errors..when i enter it in the myprogramminglab -BADLY NEED HELP!

public class StarPattern

{ public static void main(String[] args) { finalint rows =7; intspaces = rows/2; intstars = 1; for(inti = 0; i < rows; i++){ for(intj = 0; j < spaces; j ++){ System.out.print(""); }for(intj = 0; j < stars; j ++){ System.out.print("*"); }System.out.println(); if(i< rows/2){ spaces--; stars+= 2; }else{ spaces++; stars-= 2; } } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!