subject

Complete the program below that takes in one positive, odd, integer, n (at least 3), and prints a "diamond" shape of stars with the widest part of the diamond consisting of n stars. For example, if the input is n=5, the output would be: *
***

***
*
If the input is n=9, the output would be:
*
***





***
*
The diamond shape has rows of stars (asterisks) with and odd number of stars on each row. In the n=9 example, the rows had 1 star, 3 stars, 5 stars, 7 stars, 9 stars, 7 stars, 5 stars, 3 stars, and 1 star. Additionally, the rows with less than n stars have leading spaces to "center" the row (so that the center star of each row is directly above/below the center star of the other rows). Spaces are important in this assignment. Assume there are no trailing spaces (spaces at the end of each row). Because n must be odd and each row will have an odd number of stars, every row will have a "center" star.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:00, sophiawatson70
Create a cell reference in a formula by typing in the cell name or         a. right-clicking the cell. b. clicking the cell. c. clicking the column where the cell is located. d. clicking the row where the cell is located.
Answers: 1
image
Computers and Technology, 23.06.2019 00:00, addisonrausch
What season was better from fortnite?
Answers: 2
image
Computers and Technology, 23.06.2019 22:30, BilliePaul95
Janice usually works on a particular workbook that contains all business related data. she decides to keep a backup of all the data in a separate workbook. she opens a new workbook to transfer the data. which option should she use to copy all the data from one workbook to another workbook?
Answers: 1
image
Computers and Technology, 24.06.2019 07:30, Isabellawuzhere
Aproject involves many computing systems working together on disjointed task towards a single goal what form of computing would the project be using
Answers: 3
You know the right answer?
Complete the program below that takes in one positive, odd, integer, n (at least 3), and prints a "d...

Questions in other subjects:

Konu
History, 06.04.2021 22:10
Konu
Mathematics, 06.04.2021 22:10
Konu
Mathematics, 06.04.2021 22:10