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
Most case fans have standard _______________ connectors that are easy to plug in but can be forced to be connected the wrong way
SIZIF [17.4K]

Answer:

Molex

Hope this Helps!

4 0
2 years ago
Describe the difference between the while loop and the do-while loop.
Karo-lina-s [1.5K]

Answer:

The difference between While loop and Do - While loop are explained below.

Explanation:

  • While loop : It is a looping procedure in which the statements inside the while loop are executed depending on the condition outside the while before starting the loop.
  • If the condition is true then the code inside loop is executed otherwise not.
  • Do - While loop:  It is a looping procedure in which the statements inside the loop get executed and then the condition at the end of the loop is checked.
  • This means even the condition is fails the statements inside the loop are executed once.
  • Do while loop name itself suggests that "do the while and then check the condition".  
7 0
3 years ago
What is the purpose of a email
jasenka [17]

Answer:

An email is a digital message sent electronically from one computer to one or more other computers. Emails are flexible and can be used for giving instructions, serving as documentation, providing confirmation, communicating rules and procedures, making recommendations, providing a status update, making an inquiry.

7 0
3 years ago
Read 2 more answers
Topological sort requires only a tiny addition to the DFS algorithms. Exactly one of the following data structures is required t
Alekssandra [29.7K]

Answer:

Stack.

Explanation:

Topological sort requires a bit of addition to DFS algorithm.So DFS can be done by two ways that are either you can use recursion or you can use Stack data structure to implement DFS.

Since recursion uses stack memory when it makes recursive calls and if you want to do it iteratively you can stack data structure.

8 0
2 years ago
Sequentially prenumbered forms are an example of a(n): a. Processing control. b. Data transmission control. c. Input control. d.
Stella [2.4K]

Answer:

Sequentially pre-numbered forms are an example of a(n):

c. Input control.

Explanation:

  • Such a type of control in which keep updating data on the basis of monitoring of data is known as Processing Control. Data matching is an example of processing control.
  • Data Transmission Control is such a control in which transmission of data    is done. Parity check is an example of data transmission control.
  • Input Control is such type of control in which user can perform different tasks like adding text. Sequentially pre-numberered forms and turn around documents are an example of an input control.
  • Examples of Data entry control include batch total and validity check.

7 0
3 years ago
Other questions:
  • Which diagrams represent how roles can affect careers and lifestyles
    11·1 answer
  • Which type of chemical bonds are formed by sharing electrons?
    11·1 answer
  • Why is it difficult to enforce laws against intellectual theft?
    10·1 answer
  • Write a method so that the main() code below can be replaced by the simpler code that calls method mphandminutestomiles(). origi
    14·2 answers
  • You manage an NLB cluster composed of three servers: Server1, Server2 and Server3. Your maintenance schedule indicates that Serv
    15·1 answer
  • An element in an array is 4 bytes long and there are 10 elements in the array. How big is the array?
    6·2 answers
  • You are creating a presentation and you have come to the last slide. You still have more information to add. What should you do?
    7·1 answer
  • Calculate the resistance of an unknown resistor in a circuit with 30 volts and 6 amps. The formula is R = V/I.
    6·1 answer
  • Dunbar's number, 150, refers to the number of:
    5·1 answer
  • What is the primary way that social networks work? Multiple Choice providing a security system for communication online connecti
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!