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
Sergio039 [100]
3 years ago
8

Write a main method that prompts the user for an integer between 1 & 20 (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:
yarga [219]3 years ago
4 0

Answer:

int main() {

   int num;

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

   cin>>num;

   if(num<1 || num>20)

   {

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

       {

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

           cin>>num;

       }

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

   }

return 0;

}

Explanation:

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

You might be interested in
Which of the following is true of e-learning and computer-based training (CBT)?
Firlakuza [10]

Answer:

The answer is "Option c".

Explanation:

This teaching is normally taken at the origin of machines in software-based research. It can also be installing a computer system into their computer or take the electronic training module generally sponsored by the firm's academic Online media, and the wrong option can be described as follows:

  • In option a, It is wrong because this tool is not used in training.
  • In option b, It is integrated with game and e-learning, that's why it is incorrect.
  • Option d and Options e both were wrong because it can't include delivery and standalone CBT.

3 0
3 years ago
Write a pseudocode to read 10 integer numbers and find the largest number, you need to use loop in your answer.
Sophie [7]
  1. # Algorithm to find the number of integers greater than 10 in a list
  2. list = read(list of integers)
  3. n = len(list)
  4. count = 0
  5. For i = 1 to n
  6.    If list[i] > 10:
  7.        count = count + 1
  8.    Endif
  9. End
  10. Return count
<h3>Explanation:</h3>

Then the length of the list is stored in a variable n. A variable count to store the number of integers more significant than 10 is initialized to 0.

  • Then, a for-loop is used to iterate over the list. A for-loop is used in this case because every element of the inventory needs to be checked for a value greater than 10.
  • In each iteration of the for-loop, the value at the index of the list is checked. If the value is greater than 10, then the counter variable count is incremented by 1.
  • The iterations continue till the for-loop ends. At this point, the variable count will be the number of integers greater than 10.
  • Note that in case the list does not have any number greater than 10, then the count variable will be 0.

To learn more about it, refer

to brainly.com/question/25311149

#SPJ4

3 0
2 years ago
Which tab should you click if you want to access the Show All Comments option in a worksheet?
Lostsunrise [7]

Answer: Review

Because you want to review the comments

3 0
3 years ago
Read 2 more answers
The method used to transfer information to far off place instantly is called​
ahrayia [7]

Telecommunication

Explanation:

4 0
2 years ago
Read 2 more answers
A(n) _____ access file is also known as a direct access file.
zloy xaker [14]
The answer to the question asked  above is <span>remote direct memory .

</span>A remote direct memory  access file is also known as a direct access file.

Hope my answer would be a great help for you.    If you have more questions feel free to ask here at Brainly.

5 0
3 years ago
Other questions:
  • Design an application for Bob's E-Z Loans. The application accepts a client's loan amount and monthly payment amount. Output the
    8·1 answer
  • A compound document contains _______ from different applications.
    12·2 answers
  • What does deploying a computer mean?
    5·2 answers
  • Quien invento el primer vehiculo con motor?
    15·2 answers
  • True or false? any webb app can be accessed and run on any computing
    12·1 answer
  • A ____ may be composed of a few individual objects or several complex groups of objects.
    9·1 answer
  • Project: Baseline, Benchmark, Objective, and Goal
    14·2 answers
  • You want to use a computer to make a painting of your backyard to go along with a story you wrote. Which software would be appro
    8·1 answer
  • Which of the following is an algorithm?
    15·2 answers
  • The data model shows the_______structrue of database.​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!