Question: Program Description Write a program to print a limited Pascal's Triangle, First, the user is instructed to enter the number of rows to be displayed,

Program Description
Write a program to print a limited Pascal's Triangle, First, the user is instructed to enter the number of rows to be displayed, and is prompted to enter an integer in the range [1..13]. The user enters a number, \( x \), and the program verifies that \(1\leq x \leq 13\). If \( x \) is out of range, the user is reprompted until they enter a value in the specified range. The program then calculates and displays the first \( x \) rows of Pascal's Triangle.
Program Requirements
1. The programmer's name and program title must appear in the output.
2. The inain procedure must consist of only procedure calls (with any necessary framing) it should be a readable "list" of what the program will do.
3. Each procedure will implement a section of the program logic, Le, each procedure will specify frow the logic of its section is implemented.
The program must be modularized into at least the following procedures and sub-procedures:
```
introduction - Introduce Program and Programmer
getUserInput - Prompt for and receive user-mput number of triangle lines to print. Validate user input is in specified bounds and re-
prompts as necessary.
```
printPascaltriangle - Receives number of rows of Pascal's Triangle to print. Prints this number of rows of Pascal's Triangle. Uses:
printPoscaiRou to print each line.
-Receives two values, n and k. Outputs the result of "n Choose k" computation. See Binomial Coefficient Wikipedia Article
for more details.
- printPascalRow - Receives index of row to be printed. Prints allelements of Pascal's Triangle for this row. Uses nchoosek procedure to obtain each element to be printed.
a Thanks user for using the program.
- The upper and lower bounds of user input must be defined as constants.
- The directive is not allowed on this project.
- If the user enters a number outside the range [1...13] an error message must be displayed and the user must be prompted to re-enter the number of lines of the Triangle to be shown.
Program Description Write a program to print a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!