Computers and Technology

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 01:30, tanya44737
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
image
Computers and Technology, 24.06.2019 20:30, glstephens04
How is energy expended in active transport
Answers: 1
image
Computers and Technology, 24.06.2019 22:00, sierrawalk2283
True or false technology is often discovered by accident
Answers: 2
image
Computers and Technology, 25.06.2019 00:30, jennynmike03
Which of these serves as a bridge between the programming team and the audio team?
Answers: 2
Do you know the correct 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
Mathematics, 13.02.2020 06:33
Konu
Mathematics, 13.02.2020 06:33
Konu
Mathematics, 13.02.2020 06:33