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 carrier sense technology is used on wireless networks to reduce collisions?
skad [1K]
CSMA/CA is used on wireless networks to reduce collisions.
8 0
3 years ago
T in your computer will you use to plug in your camera?
Gnom [1K]
A tool in your computer that you will use to plug in your camera is the Universal Serial Bus (USB). If you camera has this chord and it is an Universal Serial Bus type. Then what you need is your software installer of the camera and only the USB.
7 0
4 years ago
If you need to grasp the topic of a document quickly, which strategy can you follow? A. guessing from context B. paraphrasing C.
Lynna [10]

If you need to grasp the topic of a document quickly, you can use previewing. Correct answer: C

With previewing the document you will get an idea of what it is about without actually reading the main body of the document. Previewing includes reading the the title and author details, reading only the parts that ‘jump out’; that is: main headings and sub headings and examining any illustrations, graphs, tables..

8 0
3 years ago
Read 2 more answers
Write the pseudo-code of an algorithm that returns the sum of all integers in a list of integers. You may use the Pascal-like ps
Arlecino [84]

Answer:

//variable integer_list to hold a list of integers

DECLARE integer_list

ASSIGN values to integer_list

//variable sum to hold the sum of the elements in the list

DECLARE sum

ASSIGN zero to sum

//loop through the integer_list and sum all it's elements together.

for(int i=0; i<integer_list.size(); i++){

sum += interger_list.get(i)

}

//Show the result of the addition from the for loop

DISPLAY "The sum is " + sum

Explanation:

The above code uses some hypothetical programming language syntax. The second and third lines declare an arbitrary integer list and assign a set of values to it respectively.  

The fifth line declares a variable "sum" which will hold the result of summing all the elements in the list. The sixth line initializes "sum" to zero.

The for loop shown iterates through the integer list cumulatively summing its elements.

The result is displayed as written on line 12.

Hope it helps!  

3 0
4 years ago
To change the overall design of an entire document to include colors, fonts, and effects, a user should apply a _____.
Olenka [21]
User should apply a theme.

Hope this helps!
8 0
3 years ago
Read 2 more answers
Other questions:
  • Jen wants to protect the schools network from hackers,worms,and viruses.she also wants to regulate access to certain websites th
    15·2 answers
  • A new computer workstation has been installed in a small office. the user of the workstation can print a document using a networ
    9·1 answer
  • What advantages do fiber optic cables offer over twisted pair or other media choices?
    8·1 answer
  • B. Does “refactoring” mean that you modify the entire design iteratively? If not, what does it mean?
    7·1 answer
  • What is employee Internet management (EIM) software?
    5·2 answers
  • Which of the following are used to classify plutons
    14·1 answer
  • Attach 2 screen shots demonstrating an understanding of file management tools, such as keyboard shortcuts, copy, paste, delete,
    8·1 answer
  • 1 Which one of the following is a transmission
    9·1 answer
  • If you delete search results, you will a. clear the history on the computer. b. delete files from our computer. c. modify the re
    14·1 answer
  • Doctrine Creative is a video production company with its own file server within its business office. The company needs to be abl
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!