Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that inputs an odd number from 1 to 35 and prints a diamond of a

ID: 3617418 • Letter: W

Question

 Write a program that inputs an odd number from 1 to 35 and prints a diamond of  asterisks.
You may only use output statements that print a single asterisk (*) or a
single blank. q6ximize the use of repetition with nested for loops and
minimize the number of output statements.
Check the input to make sure it is not an even number nor it is outside
the range. Use do...while to ensure acceptable input value.


Expected Output:

Enter an odd number for rows (1 to 35) for the diamond of asterisks : 22
22 is not an odd number. Please re-try.
Enter an odd number for rows (1 to 35) for the diamond of asterisks : -4
-4 is outside the range. Please re-try.
Enter an odd number for rows (1 to 35) for the diamond of asterisks : 39
39 is outside the range. Please re-try.
Enter an odd number for rows (1 to 35) for the diamond of asterisks : 5
*
***
*****
***
*

Enter an odd number for rows (1 to 35) for the diamond of asterisks : 23
*
***
*****
*******
*********
***********
*************
***************
*****************
*******************
*********************
***********************
*********************
*******************
*****************
***************
*************
***********
*********
*******
*****
***
*

Enter an odd number for rows (1 to 35) for the diamond of asterisks : 35
*
***
*****
*******
*********
***********
*************
***************
*****************
*******************
*********************
***********************
*************************
***************************
*****************************
*******************************
*********************************
***********************************
*********************************
*******************************
*****************************
***************************
*************************
***********************
*********************
*******************
*****************
***************
*************
***********
*********
*******
*****
***
*

Explanation / Answer

please rate - thanks In response to your message a diamond #include using namespace std; int main() {int i,j,k,size; do     {      coutsize;      if(size35||size%2==0)          cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote