1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
AlekseyPX
3 years ago
10

Write a main method that prompts the user for an integer between 1 & 10 (inclusive). If the user enters an invalid number, p

rompt for another one. When a valid number is entered, call activity with that number as a parameter.
Computers and Technology
1 answer:
stepan [7]3 years ago
5 0

Answer:

int main() {

   int n;

   cout<<"Enter the integer n"<<endl;

   cin>>n;

   if(n<1 || n>10)

   {

       while(n>10 || n<1)//taking input if the number is not within range..

       {

           cout<<"Enter the number again"<<endl;

           cin>>n;

       }

       activity(n);//calling activity with the n..

   }

return 0;

}

Explanation:

Above written is the main function in which a prompting an integer between 1 and 10 if it is not within range then again taking input.Then after that calling activity with n as argument.

You might be interested in
Match the definitions to their respective cli hot keys and shortcuts. (not all options are used.)
lord [1]
  • Tab ( Complete omitted commands and parameters )
  • Space bar ( Display the next screen )
  • Up arrow ( Scroll backward through previously entered commands )
  • ? ( Provides context-sensitive help )
  • Ctrl Shift 6 ( Cancel commands such as trace and ping).

What is CLI tools ?

A command line interface (CLI) is a text-based user interface (UI) used to run programs, manage computer files, and interact with a computer. A command line interface is also known as a command line user interface, console user interface, or character user interface.

Why do we use CLI tools ?

The CLI is a command line utility that accepts text input and executes operating system functions. In the 1960s,  this was the only way to interact with a computer, as only computer terminals were in use. In the 1970s and 1980s, command line input was widely used on Unix systems and personal computer systems such as MS-DOS and Apple DOS.

To know more about CLI Tools visit here:

brainly.com/question/13263568

#SPJ4

4 0
1 year ago
Artie believes that all Asian people are more intelligent than other people. Artie is engaging in?
Luden [163]
Artie is Stereotyping
5 0
3 years ago
Read 2 more answers
When did the silver market drop sharply, hurting Bolivia's income?
seropon [69]
The silver market dropped sharply in <span>1898,</span> hurting Bolivia's income.

The entire mining business was in decline as a result of destruction, flooding, and abandonment of mines. Lack of investment and insufficiency of labor contributed to a pointy drop by silver production. Agricultural production was low, and Bolivia had to import food, even the essential staples consumed by the Indian population. the government had serious money difficulties as a result of the massive military expenditures and debt payments to the Republic of Peru as compensation for the military of liberation. of these issues were aggravated by the isolation of the new republic from the skin world and therefore the difficulties of securing its borders.
7 0
3 years ago
Read 2 more answers
In the context of customer relationship management (CRM) applications, which approach is often chosen by organizations with an e
Bad White [126]

The on-premise approach is often chosen by organizations with an established IT infrastructure.

<h3>What is the On Premises?</h3>

In an on-premises method, resources are said to be given or deployed in-house and it is one that is found within an enterprise's IT infrastructure.

Customer relationship management (CRM) is known to be a form of a technology that is often used in the act of managing all of a firm's  relationships and communications with customers and also that of potential customers.

Therefore, The on-premise approach is often chosen by organizations with an established IT infrastructure.

Learn more about CRM from

brainly.com/question/27373018

#SPJ1

5 0
2 years ago
Write a statement that reads a floating point value from standard input into temperature. Assume that temperature. has already b
Vladimir79 [104]

Answer:

cin>>temperature;

Explanation:

This statement in c++ will take the input.The value entered by the user  on the screen will be stored in the variable temperature. cin is an standard input method in c++ and is used take input from the screen. It is an object of istream class that is standard input stream .It corresponds to C stream stdin.

8 0
3 years ago
Other questions:
  • A college meal plan allows students to:
    7·2 answers
  • 3. A hyperlink is important because it allows you to ___________. (1 point) click on the link to go directly to a website insert
    9·1 answer
  • In which of the following situations will a macro make your work more efficient?
    12·1 answer
  • Question 12 :A user complains that his computer is taking a long time to boot. During the boot process, you observe that the har
    7·1 answer
  • What does phishing mean?
    9·2 answers
  • What device is used to transmit what is effectively a type of Morse code between stations?
    11·1 answer
  • Create a basic program that accomplishes the following requirements: Allows the user to input 2 number , a starting number x and
    12·1 answer
  • What are the features of the title bar for the Microsoft word application?​
    15·2 answers
  • A network administrator is importing a list of certificates from an online source, so that employees can use a chain of trust an
    10·1 answer
  • E. Write an algorithm to show 'How to prepare a cucumber sandwich?". ​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!