Write a program that asks the user to enter an integer

Assignment Help C/C++ Programming
Reference no: EM132106313

Program

Write a program that asks the user to enter an integer between 1 and 15. If the number entered is outside that range, your program should print out an error message and re-prompt for another number. (This is an opportunity to write an input validation loop.)

Once the user enters a number in the correct range, your program will print out four patterns of asterisks that look like the following. Note that the number provided by the user is equal to the height of the pattern.

Example- If the input value is 5, please print the following four patterns:

* * * * *

* * * *

* * *

* *

*

* * * * *

* * * *

* * *

* *

*

 

*

* * *

* * * * *

* * * * * * *

* * * * * * * * *

*

* *

* *

* *

* * * * * * * * *

As you can see, the input value represents the height of the triangle.

Your program should only print one asterisk at a time and use loops to control the number of asterisks printed per line.

Reference no: EM132106313

Questions Cloud

School administrators that may affect collaboration : What are three practical issues faced by teachers and school administrators that may affect collaboration?
How a single process creates a child process : Both parent and child processes interact with each other through shared memory-based communication scheme or message passing scheme.
Terminate and return the status code of the number : In the parent, Program 1 will read from standard input pairs of integers and writes the sum and difference of the integers to the pipe.
Write a program that ask the user to type ten integers : Write a program in c++ that ask the user to type 10 integers of an array and an integer value X, the program must put the value X in the index 0.
Write a program that asks the user to enter an integer : Write a program that asks the user to enter an integer between 1 and 15. If the number entered is outside that range, your program should print out.
Quasi-single case designs fitting into clinical practice : How do you see the information on small group and quasi-single case designs fitting into clinical practice?
Write a program to produce a cross table : Write a program to produce a cross table. This table should be built from a single int8 value provided by the user.
Sigmund freud and karen horney : What is the main sticking point between the theories of Sigmund Freud and Karen Horney? How are their theories alike? Which do you agree with, if either?
Type of diagnoses for the same person : Sometimes many different psychologists come up with different type of diagnoses for the same person. How these different psychologists

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program that obtains two integer numbers from users

Pseudo code is an informal high-level and compact description of a computer programming algorithm that uses structural conventions of a programming language. Write a program that obtains two integer numbers from the user

  Write a program that first prompts the user

Write a program that first prompts the user (repeatedly , if necessary) to supply a single digit(0,1,2..9) The program should repeatedly prompt the user for integer values until a sentinel value of 0 is entered to terminate the program.

  Write a console-based object-oriented c++ program

Write a console-based object-oriented C++ program that generates a random number and prompts the user to guess it

  Write a pseudocode and draw flowchart for the program

Please help with a pseudocode and flowchart for the program, that follows the guidelines of good program design, like meaningful variable names and thoroughly commented code.

  Calculate the input value required to yield a desired outcom

What is the name of the special add-in program provided by Excel 2003, which enables advanced data analysis tools for performing complex statistical and engineering calculations?

  Write a c++ code for how to learn oop

Write a C++ code for How to learn OOP (Object oriented programming) by CPP(C Plus Plus) - general-purpose programming language

  Lab9 c if you can start with attachments file first get

if you can start with attachments file first get that part then start with the lab 9 ltbrgtcmpet301lab9

  Write a program that will read in number of 2 point basket

Write a program that will read in the number of 2 point baskets and the number of 3 point baskets a player makes.  Print the number of each baskets and the total number of points scored.

  Program initializes an array with numbers

A program initializes an array with these numbers and then lets the player enter this week's winning five-digit number.

  Problem of computing a set of equivalent elements

The problem of computing a set of equivalent elements arises in many applications. Recall that an equivalence relation defined on a set of elements is a relation that is reflexive, symmetric and transitive.

  Program that calculates and prints average of several grades

Write a C program that calculates and prints the average of several grades entered by the user. The program should first prompt the user to enter the number of grades to process (at least 2 grades must be entered by user!)

  Determine the direction of operands

If the operands in the expressions are evaluated right to left? Let the function fun be defined as

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