answer.
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]
2 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]2 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
Write a static method named countLastDigits that accepts an array of integers as a parameter and examines its elements to determ
Crazy boy [7]

Answer:

See explaination for the program code

Explanation:

code:

public static int[] countLastDigits(int[] list) {

int[] count = new int[10];

for (int i = 0; i < list.length; i++) {

int digit = list[i] % 10;

count[digit]++;

}

return count;

}

8 0
2 years ago
A _______ bulb contains a high-pressure gas. Oils from the hands can affect the expansion of the glass, which can shorten the li
shusha [124]

Answer:

I'd go with the 2nd one

If it heats up more & more, then it's lifespan will be shortened more & more.  The more it heats up, the less durability it has.

6 0
1 year ago
While adding voices to an animation, what kind of room should you choose?
MrRissso [65]

Answer:

A. A quiet room

Explanation:

Because if you open the windows the will be noise

a huge room will echoe

a room with air conditioning will make noise

7 0
2 years ago
System design is the determination of the overall system architecture-consisting of a set of physical processing components, ___
Alenkinab [10]

Answer:

C) Hardware, Software, People

Explanation:

System design is the determination of the overall system architecture-consisting of a set of physical processing components, Hardware, Software, People and the communication among them-that will satisfy the system’s essential requirements.

5 0
2 years ago
Read 2 more answers
Develop an EER model for the following situation using the traditional EER notation, the Visio notation, or the subtypes inside
podryga [215]

Answer:

Explanation:

To develop the model for Creating the supertype/subtype relationship three diffrent types of notation is given bellow accrdig to the diagram attached.

1.Traditional EER (Enhance Entity-Relational) notation

2.Microsoft Visio notation

3.Subtypes Inside supertype note

<em><u>Traditional EER(Enhance Entity-Relational)notation for the international school of technology diagram is attached bellow</u></em>

The diagram consist of the following entity

Room Supertype

Media Entity Type

COURSE entity type

Section weak entity type

Schedule associatiative entity type

<u><em>Microsoft Visio Notation for the international school of technology  is ashown in the diagram bellow.</em></u>

The diagram consist of the following entity

Room Supertype

Media Entity Type

Computer entity type

Instructor entity type

Time slot entity type

<u><em>Subtype Inside Supertype note Notation for the international school of technology  is shown in the diagram bellow.</em></u>

The diagram consist of the following entity

Room Supertype

Media Entity Type

Computer entity type

Instructor entity type

Time slot entity type

3 0
2 years ago
Other questions:
  • A chemical found in the synaptic vesicles , which , when released . has an effect on the next cell is called a?
    10·1 answer
  • What is the argument in this function =AVERAGE(F3:F26)
    15·1 answer
  • In three to five sentences, explain how you would insert graphics using your word-processing software.
    7·2 answers
  • On the Picture Tools Layout tab, you can preview results of the numerous styles, borders, effects, and layouts by _______ comman
    7·2 answers
  • Suppose that a 10-mb file is stored on a disk on the same track (track 50) in consecutive sectors. the disk arm is currently sit
    13·1 answer
  • Secure Wi-Fi networks and VPNs use _____ to secure data transferred over a network.
    13·1 answer
  • Assume the input data is structured as follows: first there is a non-negative integer specifying the number of employee timeshee
    9·1 answer
  • What output is produced by the following program segment? Why? (Recall that name.charAt(i) is the i-th character in the string,
    11·1 answer
  • Your company wants to conduct an exploratory study to gain new insights into some product changes you are considering. Which typ
    15·1 answer
  • For any element in keysList with a value greater than 60, print the corresponding value in itemsList, followed by a semicolon (n
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!