Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c program use a for loop Description This assignment is to write a program that will prompt the user to enter a character, e.g, a

image text in transcribed c program use a for loop
image text in transcribed
Description This assignment is to write a program that will prompt the user to enter a character, e.g, a percent sign (%), and then the number of that character they want on a line. Your program should first read a character from the keyboard, excluding whitespaces, and then print a message indicating that the number must be in the range 1 to 79 (both inclusive) if the user enters a number outside of that range. Your program should continue this behavior until you have received an appropriate integer. Use a loop to trap the user until you get the value that you want as you did in a previous assignment. You should also clear the keyboard buffer after each scanf so that the user can type characters or digits in their response. Once you have a number in the appropriate range, call a function that you write called drawLine that takes two arguments. One argument is the number of characters and the other argument is the character to draw. The function will use a for loop to draw that number of characters on the screen and then will print a newline. > run Please enter the character you want to draw: Please enter the number of characters you want in your line: -8 I'm sorry, that number is unrecoginized or out of range, try [1-79): why? I'm sorry, that number is unrecoginized or out of range, try (1-79): draw them! I'm sorry, that number is unrecoginized or out of range, try (1-79): ok, fine I'm sorry, that number is unrecoginized or out of range, try [1-79)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions

Question

=+2. What do they like better about its competition?

Answered: 1 week ago

Question

=+a. What kind of personality does the brand have?

Answered: 1 week ago