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
Establishing responsibilities, planning to best support the organization, acquiring validity, ensuring performance, conformity w
RUDIKE [14]

Answer: B. ISO 38500

Explanation:

ISO 38500 is an international Standard specifically developed by the International Organization for Standardization to oversee corporate governance of Information Technology. It lays down principles to guide directors and leaders of organizations on how to comply with regulatory requirements in the use of Information Technology within the firm.

The framework consists of six guiding principles in the use of I.T and they include; establishing responsibilities, planning or strategizing on how best to support the organization, acquisition of validity, ensuring performance, conformity with rules and respect of the human factor or behavior.

It was derived from the Australian Standard for Corporate Governance of Information and Communication Technology - AS 8015 - 200.

8 0
3 years ago
What is the purpose of a web server? What is the purpose of a web browser?
Sauron [17]

Answer: the purpose of a web browser is to help answer and needed questions, and to get to sites.

Explanation:

4 0
2 years ago
Mr. Brody made a spreadsheet with student names in order to take attendance. Which method is best for sorting this data?
user100 [1]
Maybe alphabetical order 
6 0
3 years ago
Read 2 more answers
When using a direct quotation, which one of the following is not necessary?
ss7ja [257]

Answer:

B

Explanation:

You can't rewrite a source with the writers voice. that makes no sense

6 0
4 years ago
Make a ladtract class that has 2 fields, one for the tractor's length and one for the width. The class should have a method that
Virty [35]

Explanation:

Below is the java code for the ladtract class :-

public class ladtract

{

private double length;  //length of tractor

private double width;   //width of tractor

public double calculateArea(){  

    return length*width;    //calculate and return the area of the tractor

}

public boolean equals(Object o) {

    if (o == this) {    //check if it's the same object

        return true;

    }

       if(o.length==this.length && o.width==this.width){   //check if the length and width are same for both objects

           return true;

       }

       return false;  

}

public String toString(){

    return "Area="+calculateArea(); //return the area of the tractor as a string

}

}

7 0
3 years ago
Other questions:
  • Which of the following statements is false? Speaking to your computer is a form of input. Playing a video is an example of outpu
    10·1 answer
  • Refer to the exhibit, a technician applies the configuration in the exhibit to an unconfigured router. To verify the configurati
    13·1 answer
  • The Gauss-Seidel method as an iterative technique often refers to an improved version of the Jacobi method, since the Gauss-Seid
    13·1 answer
  • Create a Trip class. Include as data members destination, distance traveled, total cost of gasoline, and number of gallons consu
    14·1 answer
  • Take the template and complete creation and ordering of the Triangular Matrix. //Complete the following Functions int**fillAry(i
    7·1 answer
  • Can someone please‼️‼️❗️help me with this?<br> I got an error that I can’t figure out how to fix it.
    6·1 answer
  • Angelina has added page numbers to her report, but all of the pages are labeled "Page 1" at the bottom. What caused
    8·2 answers
  • What gaming PC should I get
    14·2 answers
  • A network administrator determines who may access network resources by assigning users
    10·1 answer
  • 21. If you want to improve the performance of your PC, you need to upgrade the
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!