1.1 Please follow the instructions below checking to be sure simple pose and you c 1.1.1 Sample Run pation are pulp and condit H 8 wherge.15 bes and Since hedh

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.3: Interactive While Loops
Problem 6E: (Conversion) a. Write a C++ program to convert meters to feet. The program should request the...
icon
Related questions
Question
1.1 Please follow the instructions below
The goal of this problem is to use iteration (nested for loops) and condition statements ( statements) to create a pattern for any digit between 0 and 9. In
particular, your task is to write a program in C programming language to prompt the user to input a digit and also the width and height of that digit The
program will finally output the pattern of the digit with the chosen height and width (the input needs to be vaided as shown in the sample run). As an example
the following gidsdsplay the sample pattom for each digt with chosen height-7 and width
H
8
Your program should accept only a single digit (at a time) and any odd value within the range [515] for both the width and height (of the digit). You need to da
enor checking to be sure the width and height both are add value and also within the mentioned range (>5 and 15). Try to design the code to be as
simple as possible and you can use the asterisk (") and the space character to print the suggested patiem (no need to draw the grid design) Since the widh
and height of the patter are input parameters, it would be a very BAD idea to "hard code the output of patiems using just printf statements. So, you must use
ration (nested for loop) and conditions to create the desired output po
1.1.1 Sample Run
inter a single digit + 4
Enter an odd integer in range [5..15) as width 5
Enter an odd integer in range 15..15) as height: 7
The pattern for the digit 4 (width 5, height 7) =
- =
Inter a single digit
Enter an odd integer in range [5..15) as width: 2
Sorry! You need to enter odd integer in range [5..1511
Enter an odd integer in range [5..15) as width 5
nter an odd integer in range [5..15) as heights 11
The patters for the digit 9 (width 5, height 11) 1
C
Enter a single digit + 15
Sorry! You need to enter a single digit!
Inter a single digit: 2
7
1:eritefile.c
Enter a single digit
Enter an odd integer in range (5..15) as width: 2
Sorry! You need to enter odd integer in range [5..151
Enter an odd integer in range [5..15) as width: 5
Enter an odd integer in range [5..15] an height: 11
The patters for the digit 9 (width 5, height 11) =
Enter a single digit 19
Sorry! You need to enter a single digiti
Enter a single digit 2
Enter an odd integer in range [5..15) as width 16
Sorry! You need to enter odd integer in range [5..15)1
Enter an odd integer in range [5..15) as width 15
Enter an odd integer in range [5..15] an height: 3
Sorry! You need to enter odd integer in range [5..1511
Enter an odd integer in range (5..15) an height: 13
The pattern for the digit 2 (width 15, height = 13)
inter a single digiti
Enter an odd integer in range [5..15) as width 3
Sorry! You need to enter odd integer in range [5..1511
Enter an odd integer in range [5..15) as width 7
Enter an odd integer in range 15..15) an height: 4
Sorry! You need to antar odd integer in range [5..15)
nter an odd integer in range [5..15) an height: 9
the pattern for the digits (width 7, height 9)
// Uncomment the above line
// You need to write and test your code in C environment
//But enter your C code below to generate your submission file
!! YOUR CODE HERE
A
Transcribed Image Text:1.1 Please follow the instructions below The goal of this problem is to use iteration (nested for loops) and condition statements ( statements) to create a pattern for any digit between 0 and 9. In particular, your task is to write a program in C programming language to prompt the user to input a digit and also the width and height of that digit The program will finally output the pattern of the digit with the chosen height and width (the input needs to be vaided as shown in the sample run). As an example the following gidsdsplay the sample pattom for each digt with chosen height-7 and width H 8 Your program should accept only a single digit (at a time) and any odd value within the range [515] for both the width and height (of the digit). You need to da enor checking to be sure the width and height both are add value and also within the mentioned range (>5 and 15). Try to design the code to be as simple as possible and you can use the asterisk (") and the space character to print the suggested patiem (no need to draw the grid design) Since the widh and height of the patter are input parameters, it would be a very BAD idea to "hard code the output of patiems using just printf statements. So, you must use ration (nested for loop) and conditions to create the desired output po 1.1.1 Sample Run inter a single digit + 4 Enter an odd integer in range [5..15) as width 5 Enter an odd integer in range 15..15) as height: 7 The pattern for the digit 4 (width 5, height 7) = - = Inter a single digit Enter an odd integer in range [5..15) as width: 2 Sorry! You need to enter odd integer in range [5..1511 Enter an odd integer in range [5..15) as width 5 nter an odd integer in range [5..15) as heights 11 The patters for the digit 9 (width 5, height 11) 1 C Enter a single digit + 15 Sorry! You need to enter a single digit! Inter a single digit: 2 7 1:eritefile.c Enter a single digit Enter an odd integer in range (5..15) as width: 2 Sorry! You need to enter odd integer in range [5..151 Enter an odd integer in range [5..15) as width: 5 Enter an odd integer in range [5..15] an height: 11 The patters for the digit 9 (width 5, height 11) = Enter a single digit 19 Sorry! You need to enter a single digiti Enter a single digit 2 Enter an odd integer in range [5..15) as width 16 Sorry! You need to enter odd integer in range [5..15)1 Enter an odd integer in range [5..15) as width 15 Enter an odd integer in range [5..15] an height: 3 Sorry! You need to enter odd integer in range [5..1511 Enter an odd integer in range (5..15) an height: 13 The pattern for the digit 2 (width 15, height = 13) inter a single digiti Enter an odd integer in range [5..15) as width 3 Sorry! You need to enter odd integer in range [5..1511 Enter an odd integer in range [5..15) as width 7 Enter an odd integer in range 15..15) an height: 4 Sorry! You need to antar odd integer in range [5..15) nter an odd integer in range [5..15) an height: 9 the pattern for the digits (width 7, height 9) // Uncomment the above line // You need to write and test your code in C environment //But enter your C code below to generate your submission file !! YOUR CODE HERE A
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Managing System
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr