Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Write a program that will draw a box of asterisks on the screen. Your program will prompt the user to enter the number of asterisks they want on a line as you did for Daily 10. Your program should print a message indicating that the number must be in the range 1 to 79 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. 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 prompt the user to enter the number of lines the user wants in a box. Use the same procedure as above but force the user to enter a value between 1 and 23.

Once you have both numbers, call a function that you write called draw_box that takes two arguments of type integer where the first argument represents the number of lines and the second argument represents the number of asterisks in each line. In the draw_box function use a loop to call the draw_line function you created in daily10 the appropriate number of times to draw the requested box.

You may notice that the code to force the user to input an integer in a specified range is very similar between asking for the number of asterisks in a line and asking for the number of requested lines. You may want to try using a function that takes two arguments, a starting acceptable value and an ending acceptable value.

The function can then handle all the work involved in reading in a value and checking to see if it is in the specified range. Once you have a value in the specified range you can return it and save it in a variable in the calling function. This functionality is OPTIONAL for this assignment.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91424145
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Whats the difference between a bigfile tablespace and a

What's the difference between a Bigfile tablespace and a Smallfile tablespace? Explain which you would use for your database and why.

Calculate the thinkness of the monolayer assuming that the

Calculate the thinkness of the monolayer assuming that the volume of the monolayer is 7.39×10-6 mL and diameter of the watch glass is 5 cm.

Simple xml checkerobjectivewrite a program that checks

Simple XML Checker! Objective: Write a program that checks whether or not a given file is formatted correctly for a very simple version of XML. In this simple version of XML you have tags that denote information. Each ta ...

Question what are the advantages and disadvantages of using

Question: What are the advantages and disadvantages of using the same system-call interface for manipulating both files and devices? It is sometimes difficult to achieve a layered approach if two components of the operat ...

Decision support systems dss what sorts of dss tools do you

Decision support systems (DSS). What sorts of DSS tools do you use at your work - e.g., what-if analysis, sensitivity analysis, scenario analysis, goal-seeking analysis, optimization analysis, etc.? Even if you don't use ...

Questionusing the cost-benefit analysis method estimate how

Question..... Using the cost-benefit analysis method, estimate how much money MidCorp should spend on power protection. You will have to make several assumptions to do this. Your answer should contain an "assumptions" se ...

Can someone help me do this i need trace route of

Can someone help me do this i need trace route of Massachusetts Use trace route to trace the route from your home or work computer to the website of a university or company on another continent. Show the traceroute outpu ...

Question there are a number of key steps necessary to

Question: There are a number of key steps necessary to effectively handle an incident. Please briefly describe the basic activities in the incident response procedure . Choose two activities in the basic activities in th ...

Request this to be done in jgrasp1 add a method to the

Request this to be done in JGrasp 1. Add a method to the program that calculates the cube of every number between a lower bound and an upper bound that a user inputs (for instance, lower bound 1 and upper bound 9, for be ...

Planks plants had net income of 4000 on sales of 70000 last

Plank's Plants had net income of $4,000 on sales of $70,000 last year. The firm paid a dividend of $1,480. Total assets were $200,000, of which $80,000 was financed by debt. a. What is the firm's sustainable growth rate? ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As