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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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