Instructions
Instructions
User Manual:
Open the PDF directly: View PDF
.
Page Count: 1
| Download | |
| Open PDF In Browser | View PDF |
Instructions Write a program that uses "for" structures to print the following triangular shape (shape 1). You need to ask the user how many lines he/she wants in the shape (for example, the lines for shape1 is 8). Maximize your use of repetition (using nested 'for' structures) and minimizes the number of output statements (cout). After you finish the program that prints out the triangular shape, write another program to print out a hollow diamond shape (shape 2). You need to ask the user to input a maximum number of spaces in each line(for example, in shape 2, the maximum number is 7, the line in shape 2 which has the most spaces has 7 spaces). In the diamond shape, the input maximum number should be odd. If the user doesn't enter an odd number, tell him/her to enter an odd number. Please attach two .cpp files(one is for triangular shape, the other is for diamond shape) and the screenshots of your result(.jpg) Shape 1: * ** *** **** ***** ****** ******* ******** Shape 2: * ** * * * * * * * * * * ** *
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.3 Linearized : No Page Count : 1 Title : Microsoft Word - Document6 Producer : macOS Version 10.14.2 (Build 18C54) Quartz PDFContext Creator : Word Create Date : 2018:12:29 21:57:33Z Modify Date : 2018:12:29 21:57:33ZEXIF Metadata provided by EXIF.tools