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
What are the 5 general terms of the fair use rule
Andrews [41]

the purpose and character of your use.

the nature of the copyrighted work.

the amount and substantiality of the portion taken, and.

the effect of the use upon the potential market

In its most general sense, a fair use is any copying of copyrighted material done for a limited and “transformative” purpose, such as to comment upon, criticize, or parody a copyrighted work. Such uses can be done without permission from the copyright owner

the nature of the copyrighted work; the amount and substantiality of the portion used in relation to the copyrighted work as a whole; and. the effect of the use upon the potential market for or value of the copyrighted work

uwu hope dis halpz!

5 0
3 years ago
There exists a data type Date with member function Increment that increments the current Date object by one. The ++ operator is
nalin [4]

Answer:

Date Date::operator++( int )

{

Date temp = *this;

Increment();

return temp;

}

Explanation:

Of options 1 through 4, only option 4 correctly implement the post increment of the ++ operator.

Interpreting each line of option for and comparing it to other options

Line 1: Date Date::operator++( int )

This declares the data type and its ++ operator

This is same for all options

Line 2: The Date type needs to be declared

In option 4, it was declared correctly as Date temp = *this;  using a pointer variable *this.

Here, option 2 is removed from the list of possible options.

Comparing other options

Line 3: The member increment option needs to be declared after the declaration of the date type variable.

This is correctly declared as Increment();  in option 4

Here, option 3 is removed from the list of possible options.

Comparing other options

Line 4: The value declared variable temp needs to be returned the way it was declared (without pointer indicator)

Hence, option 4 is best appropriate

3 0
3 years ago
Mary is writing an article about the software development life cycle. She wants to place a flowchart besides the text. Which men
vichka [17]
The answer to this question is that Mary should choose insert image . Then, in the wrap text Mary should choose “top and bottom” to add it below the text she wrote. Using the option Top and bottom - text appears at the top and bottom of the image.
4 0
3 years ago
Read 2 more answers
Speech about society being normal
Kisachek [45]

Answer:

Do you know what is best about America? It’s really the fact that the right to equality has been ensured at the maximum level, and for all. And the citizens respect their family and this is being showcased proudly by Sir Donald Trump who not only looks after the whole US without ever hesitating no matter whatever might be the issue and at the same time also look after his great and proven proud family. And that explains in itself why America is so great. And this is a perfect specimen of an inordinate democracy, and that is why American Democracy is so fruitful. There is sufficient money, all sorts of resources, the most influential military, and the world's finest technology. And American history can be a petite one, but it is one of the most noticeable histories in the entire world. You will not find such a great history in any other part of the world. And George Washington, the father of the country set such an example that the next various generations of great leaders were able to build such a great America. It is a society where every citizen enjoys equal rights, and a day before Sir Trump issued various prisoners with graduate degrees, to help them to return to the mainstream of life. No other society in the whole world enjoys such a level of privileges on behalf of equality. And that’s why the US society can be termed as the most normal in the whole world.

Explanation:

Please check the answer section. And I have chosen US as it is the most fruitful democracy of the world. And I feel all the counrtries from the entire world, should learn a lesson from the short history of United States. This is the way in which we can sight a normal society.

3 0
3 years ago
What is a variable?
aleksandr82 [10.1K]
Answer. D: a value that looks loads when the program runs.


Explanation:

In programming, a variable is a value that can change, depending on conditions or on information passed to the program. Typically, a program consists of instruction s that tell the computer what to do and data that the program uses when it is running.
5 0
3 years ago
Other questions:
  • Write a function shampoo_instructions() with parameter num_cycles. If num_cycles is less than 1, print "Too few.". If more than
    7·1 answer
  • Consider the following classes: public class Vehicle {...} public class Car extends Vehicle {...} public class SUV extends Car {
    8·1 answer
  • The blue bar across the top of the screen informs you of the Screen Title, or what step you are on.
    5·1 answer
  • When Creating a FPS game what basic rules would you add?
    12·1 answer
  • The average price of milk increased from $3.00 last year to $3.50 this year. This is most likely due to:
    14·1 answer
  • Every Java statement ends with: *<br><br> Period<br> Colon<br> Double quote<br> Semicolon
    11·2 answers
  • Can someone please help me to point out what's wrong with this C program:
    13·1 answer
  • 19. Fatigue can help improve your reaction time.<br> False<br> O True
    8·2 answers
  • Which of the following helps you plan out every step of an animation?
    12·2 answers
  • What makes a recipe for a meal an example of an algorithm?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!