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

  Convert the star schema to a snowflake schema

Using these principals, convert the star schema to a snowflake schema. What impact (if any) does this have on the size of the fact table for this problem?

  Write pseudocode algorithms addition subtraction multiply

Describe the classes and write pseudo-code algorithms to perform addition, subtraction and multiplication of polynomial expressions.

  Can someone explain to me what is wrong

Provided is two functions. The function addLarge is called from main and is supposed to retrieve two strings from the user and print those strings. When I compile this code, only the second string prints. Can someone explain to me what is wrong?

  Write an update statement to change the phone number

Write an UPDATE statement to change the phone number of employee with EmployeeNumber 11 to 360-287-8810. Run this SQL statement.

  Write the function xsort which takes in a list of strings

Write the function Xsort wich takes in a list of strings and returns sorted list with all words beginning wih "X" first in the list. f.ex: xsort (['kex', 'xylofonn', 'epli', 'xenos', 'asni']) returns ['xenos', 'xylofonn', 'asni', 'epli', 'kex'] th..

  Event drive programming

Lets look at event drive programming. What is an event driven program? What are events associated with? What are examples of common events?

  Implements a wireless network

Describe the security threats that a company will face when it implements a wireless network. Assume that the company occupies the six middle floors in a 12- story office building that is located in a downtown business area between two other building..

  User can input an odd number in the range from 1 - 25

this pattern (9 rows), modify your program so that your user can input an odd number in the range from 1 - 25 for the number of rows in the diamond.

  Binary scientific notation

For IEEE 754 single precision floating point, what is the number, as written in binary scientific notation, whose hexadecimal representation is: 0061 0000

  Electronic health record

Write a paper on Electronic Health Record (EHR) Research and Summary.

  Call and write methods with parameters and return values

Call and write methods with parameters and return values.

  The standard deviation for fe73 to achieve six sigma quality

The standard deviation for FE73 to achieve Six Sigma quality

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