Question
Input: The program prompts for the name of an input file and the name of an output file. The input file contains two positive (non-zero)
Input: The program prompts for the name of an input file and the name of an output file. The input file contains two positive (non-zero) integers, m and n, each less than 20, followed by a character.
Output: A file containing an m n rectangle made using the specified character. For example, if the input file contained the numbers 4 and 6 and the character as shown below, 4 6* the output file would show 4 lines of 6 stars each, as shown below:
******
******
******
******
This program will start by opening the input file and reading the numbers and the specified character. Thereafter a nested for loop will generate the pattern. The following questions are designed to step you through the process of creating the nested loop.
Question 1: Using Raptor, create a flowchart for the following process: write a specified character (denoted ch) n times on the output stream and move the cursor to the beginning of the next line. (In Raptor, the character must be put in double quotes. When writing, uncheck the end current line box to stay on the same line; write an empty string with the box checked to go to the next line.)
Question 2: Created a nested loop in Raptor. The outer loop will run the inner loop a specified number of times. The result will be rectangular block of characters. Example for constructing a nested Raptor loop can be found here. Note that when you draw the nested loop in Raptor, the outer loop is created first, and the inner loop is placed inside it.
Question 3: Implement your algorithm in C++ using the for loops.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started