1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Marrrta [24]
3 years ago
9

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.
Computers and Technology
1 answer:
avanturin [10]3 years ago
5 0

Answer:

n = int(input("Enter the n (positive odd integer): "))

for i in range(1, n+1, 2):

   print(i*"*")

for i in range(n-2, 0, -2):

   print(i*"*")

Explanation:

*The code is in Python.

Ask the user to enter the n

Create a for loop that iterates from 1 to n, incrementing by 2 in each iteration. Print the corresponding number of asterisks in each iteration

Create another for loop that iterates from n-2 to 1, decrementing by 2 in each iteration. Print the corresponding number of asterisks in each iteration

You might be interested in
How did hitles rules in nazi germany exemplify totiltarian rule?
ddd [48]

Answer:

hope this helps if not srry

7 0
3 years ago
What must you do to enable the members of the rome backup group to perform backup operations on the local system?
steposvetlana [31]
Add Rome Backup group to a membership list of a group that already has access to perform backup operations on the local system. Thank you for posting your question here at brainly. I hope the answer will help you. Feel free to ask more questions here.
5 0
3 years ago
How can getchar function be used to read multicharacter strings?​
alex41 [277]

69696969696969969696969696966969696969696V69696969696969969696969696966969696969696VVVV696969696969699696969696969669696969696966969696969696996969696969696696969696969669696969696969969696969696966969696969696V69696969696969969696969696966969696969696V6969696969696996969696969696696969696969669696969696969969696969696966969696969696V69696969696969969696969696966969696969696VVVV696969696969699696969696969669696969696966969696969696996969696969696696969696969669696969696969969696969696966969696969696V69696969696969969696969696966969696969696V6969696969696996969696969696696969696969669696969696969969696969696966969696969696V69696969696969969696969696966969696969696VVVV696969696969699696969696969669696969696966969696969696996969696969696696969696969669696969696969969696969696966969696969696V69696969696969969696969696966969696969696V69696969696969969696969696966969696969696

5 0
3 years ago
Under what circumstances does a multithreaded solution using multiple kernel threads provide better performance than a single-th
pshichka [43]

The best scenario is when a program suffers from frequent page faults. In the situations when a kernel thread experiences a page fault, another kernel thread can be switched in; something a single-threaded process will not be capable of doing. Another best circumstance is when a program has to wait for other systems events.






5 0
3 years ago
which of the following present the most significant obstacle to developing IT security if we consider commerce and marketing?
Dmitry_Shevchenko [17]

Answer:

There is no direct return on investment in building security systems.

Security systems are detrimental to usability and can make IT systems less functional, and therefore less attractive to the customer.

There is pressure to reduce the time it takes to get a new IT product or system onto the market, so security systems are sacrificed in order to reduce the time-to-market.

Explanation:

Cyber security has always been challenging for the organizations. There have been groups which are always looking for loop holes in cyber security and hacks the details and asks the ransom to restore. IT systems have now been more complex in this era. Users are increasing every new day and network accounts security is more demanding. Computer connection are more complex and require special attention to control them. The obstacles in IT systems are of concern as there is need for dynamic IT solution to counter the challenging hackers.  New programs and customized demand of IT systems need customized IT security systems.

4 0
2 years ago
Other questions:
  • Why has unicode become the standard way of converting binary to text??
    8·1 answer
  • Write an algorithm whether the given number is positive negative or zero​
    5·1 answer
  • Gabe wants to move text from one document to another document. He should _____.
    9·2 answers
  • Design a class that has an array of floating-point numbers. The constructor should accept an integer argument and dynamically al
    7·1 answer
  • According to the municipal solid waste report what are the benefits of recycling
    6·1 answer
  • Time
    6·1 answer
  • Find the equation of a line which has 10 points the following two coordinates: (4, 0) and (3, 4)​
    13·1 answer
  • What are the missing whole numbers on this number line? Enter your answers in the boxes. plz show work I'm I need answer 3rd gra
    14·1 answer
  • Submit your newsletter that includes the following: two or three columns a title at least three graphics, but not more than six
    10·2 answers
  • Which of these problems is correct if the numbers are binary numbers?Group of answer choices1 + 1 = 21 + 1 = 100 + 0 = 11 + 0 =
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!