Write a C++ console application that prints a solid rhombus based on inputs of character and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a C++ console application that prints a solid rhombus based on inputs of character and number from the user. Use a validation loop to prompt for and get from the user a number (N) in the range 10 to 20. Use another validation loop to prompt for and get from the user a character from the set [@, #, $, %, &]. Then print the rhombus using N and the character. The rhombus will have N rows and N characters in each row. Each row has a decreasing number of spaces. One solution is two inner for loops within an outer for loop. Here is sample output: CA Microsoft Visual Studio Debug Console Enter an integer between 10 and 20: 5 Error: invalid integer of 5. Enter an integer between 10 and 20: 10 Enter a char from set [@, #, $, %, &]: 9 Error: invalid char of 9. Enter a char from set [@, #, $, %, &]: & &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& Write a C++ console application that prints a solid rhombus based on inputs of character and number from the user. Use a validation loop to prompt for and get from the user a number (N) in the range 10 to 20. Use another validation loop to prompt for and get from the user a character from the set [@, #, $, %, &]. Then print the rhombus using N and the character. The rhombus will have N rows and N characters in each row. Each row has a decreasing number of spaces. One solution is two inner for loops within an outer for loop. Here is sample output: CA Microsoft Visual Studio Debug Console Enter an integer between 10 and 20: 5 Error: invalid integer of 5. Enter an integer between 10 and 20: 10 Enter a char from set [@, #, $, %, &]: 9 Error: invalid char of 9. Enter a char from set [@, #, $, %, &]: & &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&&&&
Expert Answer:
Answer rating: 100% (QA)
Heres a C console application that prints a solid rhombus based on the users input of a character an... View the full answer
Related Book For
Posted Date:
Students also viewed these operating system questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
The par yield curve for U.S. Treasury bonds is currently flat across all maturities at 5.50 percent. You have observed following "paired" transaction by your bond portfolio manager: Bond G H...
-
Using Figure 2.2, suggest the best communication channels for the following messages. Assume that all channels shown are available. Be prepared to explain your choices. Channel...
-
What guidelines are available for interpreting the factors?
-
Find the temperature at which the surface tension of water becomes zero. What is the physical significance of this temperature?
-
It is January 2 and Twin Pines Farm is putting together its annual net worth statement Following are a nurmher of pieces of information they have collected. Help them fit it all together using the...
-
Explain the two different ways to measure the real interest rate? Why can the nominal and real interest rates move in different directions?
-
Reconsider the Lockhead Aircraft Co. problem presented in Problem 16.15 regarding a project to develop a new fighter airplane for the U.S. Air Force. Management is extremely concerned that current...
-
A company's vision and mission should be aligned with ----------. a. it's resources and capabilities b. it's Brand Image. c. it's people d. the geographical location
-
Experimentally one obtains \(C_{P}=4.844 \times 10^{-23} \mathrm{~J} / \mathrm{K}\) for nitrogen gas at room temperature. (a) Calculate the heat capacity ratio \(\gamma\) for a gas of nitrogen...
-
Residents of Lake Caliopa, Minnesota, began noticing an unusually high number of lung ailments among the local population. Several concerned citizens pooled their resources and commissioned a study...
-
What systematic changes, if any, should Amy make to address the economic viability of Ohio Strong during this tumultuous period?
-
A swimming pool has a length of \(50.0 \mathrm{~m}\), a width of \(35.0 \mathrm{~m}\), and an average depth of \(2.00 \mathrm{~m}\). (a) How much energy is required to raise the temperature of the...
-
Jim and Brenda dated for approximately 12 months before they finally ended their tumultuous relationship. One evening six months into the relationship, Brenda alleges that Jim forced her to engage in...
-
What is a master budget? How is the master budget prepared and why do companies create it? Do you have a master budget in your personal life? Why or why not?
-
Prove the following D,(cos x) = - sin x (Hint: Apply the identity cos(A + B) = cos A cos B sin A sin B)
-
Program comments are also known as external documentation. True of False
-
Write a program segment that contains two If-Then statements and which inputs Num, then displays "Yes" if Num == 1 and displays "No" otherwise.
-
Which of the following is done by the computers central processing unit? a. Processing program instructions b. Performing arithmetic and logical operations c. Controlling the other components of the...
-
Use equation (17.2) to establish the following distributional relationships that are helpful for calculating quantiles. a. Assume that \(y_{0}=\alpha_{1} F / \alpha_{2}\), where \(F\) has an...
-
Assume that \(y\) is normally distributed with mean \(\mu\) and variance \(\sigma^{2}\). Let \(\phi(\cdot)\) and \(\Phi(\cdot)\) be the standard normal density and distribution functions,...
-
Consider a GB2 probability density function given in equation (17.3). a. Reparameterize the distribution by defining the new parameter \(\theta=e^{\mu}\). Show that the density can be expressed as...
Study smarter with the SolutionInn App