Write a program that will draw a box of asterisks on scrreen

Assignment Help Basic Computer Science
Reference no: EM13854385

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.

Reference no: EM13854385

Questions Cloud

Developing learning activities for a maersk customer service : Describe the importance of creating Specific, Measurable, Achievable, Realistic, and Time-oriented (SMART) objectives for a training plan. Explain the importance of developing learning activities for a Maersk Customer Service - CARE Business Partner..
Review the big five personality traits : Write 200 to 300 word essay where you explain where you think you fall within the spectrum of each of the traits. Of the five traits, where do you think your personality fits overall?
The fairest determination of income occurs : Which costing method is based on the reasoning that the fairest determination of income occurs if the current costs are matched against current sales prices
Find the maximum non-linearity as percentage of fs : Calculate the capacitance, C, of the sensor when the input displacement and Find the maximum non-linearity as percentage of FS.
Write a program that will draw a box of asterisks on scrreen : Write a program that will draw a box of asterisks on the screen
Headings for assignment-character evaluation : My Character (Name the character you are going to discuss and who they are - i.e.  character from a movie, person in the media, person who is historical)
Transition into announcing the topic : Once you have the body of the speech organized and planned, you must also add your introduction and conclusion.  With your introduction, you must first gain the attention of your audience, then transition into announcing the topic, which of course..
Write paragraph about that arabic luxury brand : The paragraph about that arabic luxury brand like Elie Saab and Reem Acra they are famous but they're marketing offline
Additional emphasis on internal controls : Sarbanes Oxley Act of 2002 (SOZ) placed additional emphasis on internal controls.  What section of SOX is specifically applicable to internal controls.  Why do you think it does?  What is the history of this?  What are the benefits or disadvantages o..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Display all of the integers from first value to second value

Display all of the integers from the first value to the second value, displaying the values vertically (that is, one value per horizontal line), with a header statement indicating that the list being displayed represents all of the integers betwee..

  Windows word is an example

Windows Word is an example of System software. Platform software.

  What is called a whitespace character

Given an int variable modelYear write a statement that assigns true to norecall if the value of modelYear does NOT fall within the two recall ranges and assigns false otherwise. Do not use an if statement in this exercise!

  Advance the quality of public service

"What I hope to accomplish in my field of study to advance the quality of public service."A. Two typewritten pages (8½ x 11, double-spaced)B. In writing your essay, please give specific examples to clarify your ideas.

  Create a catch block that catches the eventual

Create a catch block that catches the eventual IndexOutOfRangeException; within the block, display "Now you've gone too far." on the screen. Save the fi le as GoTooFar.cs. Make sure that you document your code and how to test it (test case)

  What is the formula for cost per life saved

What is the formula for cost per life saved on this following case study: Diagnosed arvophillia cases in total population Severe arvophillia among diagnosed cases

  Company culture and behavior change

Company culture and behavior change

  Websites be required to adhere to section standards

what is the purpose then? Do you think that all websites should be required to adhere to Section 508 standards? Why or why not?

  What is the paintcomponent method

Describe the types of information available to a program when using the KeyListener interface.

  Write paper on smart phones and tablets

Imagine you are a System Architect at Panther Industries. You job is to submit a report to your manager about common technologies and the use of these technologies in your corporate Information Technology (IT). Smart phones/ Tablets/ netbook archit..

  Create application that lets user select two primary colors

when the user clicks mix button,the form's background should change to the color that you get when you mix the two selected primary colors. note: i want the solution in visual c# not in c++ plz

  Draw a level 0 data flow diagram

Once the glasses have been made, you return to the store for a fitting and pay for glasses. The payment information is recorder in the order. You can use any tool to draw the diagram.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd