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
5. Many vehicles have indicator lights telling you when your
I am Lyosha [343]

Answer:

A.

Explanation:

The rest is nearly impossible to detect or not worth the time.

8 0
2 years ago
Read 2 more answers
Steps in creating a folder
enyata [817]
Right click computer screen and press new folder?
or add paper to rings in the physical folder<span />
8 0
2 years ago
2.32 LAB: Musical note frequencies On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency o
Maurinko [17]

Answer:

#include<iostream>

#include<iomanip>

#include<cmath>

using namespace std;

int main()

{

float f0;

cout<<"Initial Frequency: ";

cin>>f0;

for(int n = 1; n<=5;n++)

{

 cout<<f0<<setprecision(2);

 f0 = f0 * pow(2.0,1.0/12);

 cout<<" ";

}

 

return 0;

}

Explanation:

The programming language is not stated; However, one can easily deduce that the program is to be written using C++

The following libraries enable the program to make use of some built in functions

<em>#include<iostream> </em>

<em>#include<iomanip> </em>

<em>#include<cmath> </em>

using namespace std;

int main()

{

This line declares the initial frequency as float

float f0;

This line prompts user for input

cout<<"Initial Frequency: ";

This line gets user input

cin>>f0;

The following iteration calculates and prints the frequency for thenexr 4 keys

<em>for(int n = 1; n<=5;n++) </em>

<em> { </em>

<em>  cout<<f0<<setprecision(2); </em>

<em>  f0 = f0 * pow(2.0,1.0/12); </em>

<em>  cout<<" "; </em>

<em> }  </em>

return 0;

}

7 0
2 years ago
Which statement below correctly differentiates between frames and bits? Frames have more information in them than bits. Frames a
9966 [12]
<span>Frames have more information in them than bits.
</span>
<span>Frames are made up of bits but not vice versa.


A bit (BInary digiT) is the basic unit of digital. It can be 0 (logical false, off) or 1 (not logical false - true, on). Four bits are in a nybble, which can have a value of 0 - 15, eight bits are in a byte which can have a value of 0 - 255. Words vary in size, they consist of multiple bytes and are generally correlated with the system's data bus/processor data width (a 64 bit system has an 8 byte word).
</span>
5 0
2 years ago
Read 2 more answers
In 3–5 sentences, describe the unique challenges e-mail presents for business communications.
alina1380 [7]
One of the things that are a challenge, is that you have to get the correct puntuation, correct capitilization, because it's a buisness email. You ont want to mess a buisness email up. You also have to have no repating phrases and sentences. You can't be adding random words and saying "and" all the time. 
7 0
2 years ago
Read 2 more answers
Other questions:
  • A storyboard is essentially an outline of a web page's content and design<br> -True or False
    8·2 answers
  • Kirk found a local community college with a two-year program and he is comparing the cost with that of an out-of-state two-year
    13·2 answers
  • In a particular jurisdiction, taxi fares consist of a base fare of $4.00, plus $0.25 for every 140 meters traveled. Write a func
    11·1 answer
  • Which of the following describes ETL? a) A process that transforms information using a common set of enterprise definitions b) A
    14·1 answer
  • Imagine that you have configured the enable secret command, followed by the enable password command, from the console. You log o
    12·1 answer
  • Assume a program requires the execution of 50 x 106 FP instructions, 110 x 106 INT instructions, 80 x 106 L/S instructions, and
    9·1 answer
  • A program is loaded into _________ while it is being processed on the computer and when the program is not running it is stored
    15·2 answers
  • This program will output a right triangle based on user specified height triangle_height and symbol triangle_char. (1) The given
    9·1 answer
  • A data analyst is using the Color tool in Tableau to apply a color scheme to a data visualization. They want the visualization t
    13·1 answer
  • A group of developers for a startup company store their source code and binary files on a shared open-source repository platform
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!