Well, I'm a college student with a dread C++ online class and now my (insert explicative) professor wants us to write a program for a diamond. The actual assignment is...
Write a program that displays a diamond of given the odd length (an odd integer
size less than or equal to 21). Your program should accept as input from the
keyboard the character used to form the diamond, and the value for the length of
the diamond.
Out of range input values should result in an informative error message (if it does
not meet the specifications of this assignment).
Your program should process only one input case, legal or not. Termination occurs
after either the error message is printed or the diamond is drawn.
It is necessary that the program be written using loops.
Sample runs:
Diamond drawing program
Enter the character, and length (eg. x 7):A 7
A
A A
A A
A A
A A
A A
A
Diamond drawing program
Enter the character, and length (eg. x 7):R 17
R
R R
R R
R R
R R
R R
R R
R R
R R
R R
R R
R R
R R
R R
R R
R R
R
Diamond drawing program
Enter the character, and length (eg. x 7):A 27
You have entered an illegal value for the length. It must be between 1 and 21.
You should use a named constant (const) to define and refer to the diamond size
limit. This will make it easy to modify the program at a later date if the size
restriction is changed. Write a class called Diamond. Have the appropriate data
members for that class. Also have a constructor and a function to output the
diamond.
I'm not asking for the answer but if anyone could point me in the right direction I'd appreciate it. I'm completely lost and the son of a ***** refuses to help despite the fact he never went over this and its not in the text books.
-eyeroll-
But yeah, if anyone can help please do. Thanks!
Alex