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
Which term describes the process of training a machine to do simple, repetitive tasks, and adapt or correct its performance base
yKpoI14uk [10]
Automation. ... It involves taking a machine or software that was taught to do simple repetitive tasks (traditional automation) and teaching it to intuitively adapt or correct its performance based on changing conditions, at speed and scale.
8 0
2 years ago
What's the answer to this​
yarga [219]

Answer:

S

Explanation:

The index operator will address individual characters in the string.

5 0
3 years ago
I want to be a astrophysicist but my parents want me to be a software engineer. whuch one is better?
Andreas93 [3]
You need to discover yourself which one you love to do. Software Engineering is just science and math, programming languages and too much work, but it’s the job of this era. It’s very very desirable and one of the highest salaries in US.
7 0
2 years ago
Ark titanoboa taming
ivann1987 [24]
Huh???????................
3 0
3 years ago
Uses of internet write in point.​
Vladimir [108]

Answer:

-Electronic mail. At least 85% of the inhabitants of cyberspace send and receive e-mail. ...

-Research.

-Downloading files.

-Discussion groups. ...

-Interactive games. ...

-Education and self-improvement. ...

-Friendship and dating. ...

-Electronic newspapers and magazines.

3 0
3 years ago
Other questions:
  • Write a program for playing tic tac toe. Two players take turns marking an available cell in a 3 X 3 grid with their respective
    15·1 answer
  • How many total channels are available in the United States for wireless LAN use in the unlicensed 2.4ghz ism band ?
    6·1 answer
  • Which of the following describes an acceptable print resolution?
    7·1 answer
  • If you want to emphasize the Greek root of a word in a document, which tool in Microsoft® Word could you use?
    6·2 answers
  • What happens if i unplug my alarm system?
    11·1 answer
  • BEING TIMED HELP ASAP
    12·2 answers
  • What is the best approach to testing a website? visit all pages to verify that they load visit every page and verify all links v
    7·1 answer
  • In order for a sort to work, which of the following is required?
    14·1 answer
  • Different he launc.<br>in function are available with MS-Excel<br>Many​
    14·1 answer
  • Ask the user for five-coordinate pairs. Store each pair as a tuple, and store all the pairs in a list. Print the slope between a
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!