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
alexgriva [62]
3 years ago
12

Write an algorithm that asks a user to enter a number between 1 and 10. (This range includes the numbers 1 and 10.) When they en

ter the number, check that it is actually between 1 and 10. If it is not, ask them to enter a number again. Continue to ask until they enter a valid number. Once their number is valid, output the number. (C++ form)
Computers and Technology
1 answer:
Nataliya [291]3 years ago
4 0

Answer:

do{

   cout<<"Introduce number \n"; //print the message

   cin>>num; //set the value of the number given

}while(num<1 || num>10); //repeat while the number is out of the range

cout<<"Number: "<<num; //print the number

Explanation:

The idea behind this code is to create a loop in which I can compare the number given  (between 1 and 10) and then print the number or get back and ask the number again.

#include <iostream>

using namespace std;

int main()

{

   int num; //create num variable

do

{

   cout<<"Introduce number \n"; //print the message

   cin>>num; //set the value of the number given

}while(num<1 || num>10); //repeat while the number is out of the range

cout<<"Number: "<<num; //print the number

}

You might be interested in
You can use the___<br> to copy data from Excel to Access.
kap26 [50]

Answer:

You can use the Import spreadsheet wizard program.

Explanation:

On the Office ribbon, select the External Data tab and click Excel. The "Get External Data - Excel Spreadsheet" wizard appears. In the File name field, browse to the Excel file. Select the "Import the source data into a new table in the current database" option and click OK.

8 0
2 years ago
In GIMP, the ( ) displays the image that the user is currently working on
kotykmax [81]
I don'r know what your trying to use? GIMP is a free photo editing software just upload it to photobucket.
7 0
3 years ago
What will be the output of the following program? Assume the user responds with a 5.
FrozenT [24]

The output will be: You owe $ 15.0

4 0
3 years ago
Why do people enjoy codehs
Alex73 [517]

Answer: this is a moral question, but here is my view

Explanation:

we get to learn about things like java which i am currently learning for AP computer science A

6 0
3 years ago
The equivalent of the TTL field in an ipv4 header is known as the ___an IPv6 header
OLga [1]
<span>The equivalent of the TTL(Time to Live) field in an IPv4 header is known as the Hop Limit in an IPv6 header.
</span>The IPv6 header is a streamlined version of the IPv4 header. The field Hop Limit has the size of 8 bits and indicates the maximum number of links over which the IPv6 packet can travel before being discarded.
7 0
3 years ago
Other questions:
  • Define lan wan &amp; man
    14·1 answer
  • Write a sentence about a mineral you use and how you use it
    12·1 answer
  • How is technology closely linked to creativity
    15·1 answer
  • What kind of game was pole position?
    6·2 answers
  • Which of the following is not a web browser? A. safari B. explorer C. chrome D. google​
    12·2 answers
  • Is technology a legal discipline or law is a technological artifact.
    6·1 answer
  • Define get_date() function.
    6·1 answer
  • Can someone help me asap​
    13·1 answer
  • Why is operating system important software for computer?give 3 reasons
    8·1 answer
  • open your browser and enter the address of this ftp site in the address box: ftp.cengage. if your browser supports ftp, a logon
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!