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
Oksi-84 [34.3K]
3 years ago
15

Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less

than 100. End each prompt with a newline. Ex: For the user input 123, 395, 25, the expected output is:Enter a number (<100): Enter a number (<100): Enter a number (<100): Your number < 100 is: 25c++ #include using namespace std;int main() { int userInput = 0;do cout << "Your number < 100 is: " << userInput << endl; return 0;}
Computers and Technology
1 answer:
Ad libitum [116K]3 years ago
6 0

Answer:

#include<iostream>//library inclusion

using namespace std;

int main()

{

int userInput;

do//start of do while loop

{

 cout << "Enter a number less than a 100" << endl;

 cin >> userInput;

 if (userInput < 100) //condition

 {

  cout << "YOu entered less than a hundred: " << userInput << endl;

 }

 else

 {

  cout << "your number is greater than 100" << endl;

 }

} while (userInput > 100);//condition for do while

return 0;//termination of int main

}

Explanation:

The program has been commented for you. The do-while loop enters the first loop regardless of the condition. Then after the first iteration, it checks for the condition. If the condition is being met, it will iterate through, again. Otherwise it will break out of the loop and land on the "return 0;" line. Which also happens to be the termination of the program in this case. The if-else condition is used for the user to see when prompted.

You might be interested in
(PLATO) How can hackers obtain a person’s data? Malicious hackers can obtain a person’s data through the method of simple ___ en
EastWind [94]

The missing word here is social.

Social engineering involves using simple human methods to steal data, such as looking through peoples’ drawers for pieces of paper on which they might have written down passwords, or perhaps sneaking a look at the keys you press while walking past your desk as you are typing your password. Such behaviors designed to steal your personal information are methods of social engineering.

Let me know if you have any questions.

5 0
3 years ago
To print the last element in the array named ar, you can write :A. System.out.println(ar.length);
timofeeve [1]

Answer:

Option (d) is the correct answer.

Explanation:

An Array is used to store multiple variables in the memory in the continuous memory allocation on which starting index value is starting from 0 and the last index value location is size-1.

In java programming language the array.length is used to tells the size of the array so when the user wants to get the value of the last element, he needs to print the value of (array.length-1) location so the correct statement for the java programming language is to print the last element in the array named ar is--

System.out.println(ar[ar.length-1]);

No option provides the above statement, so option d (None of these) is correct while the reason behind the other option is not correct is as follows--

  • Option a will prints the size of the array.
  • Option b also gives the error because length is an undeclared variable.
  • Option c will give the error of array bound of an exception because it begs the value of the size+1 element of the array.
3 0
3 years ago
9. Question
Gennadij [26K]
A server stopped provide service to 100 users
5 0
2 years ago
Which of the following Internet connectivity technologies enables data to be sent over existing copper telephone lines by sendin
Pani-rosa [81]

Answer:

The answer is B. Digital subscriber line technology

Explanation:

Digital subscriber line or DSL technology is used to transmit digital data over telephone wires.

It makes file sharing possible which includes multimedia data (i.e. transfer of pictures and graphics), and also video and audio conferencing.

DSL uses a reliable medium that prevents packet loss and interruptions. It is also fast.

6 0
3 years ago
What is the part of a CSS declaration that describes the HTML tag?
jeyben [28]

Answer:

a selector

Explanation:

4 0
3 years ago
Other questions:
  • How to see if your computer has bluetooth?
    6·1 answer
  • To move up one paragraph, press the ____ key(s). f1 alt up arrow up arrow ctrl up arrow
    8·1 answer
  • 1.Electromagnetic waves can carry more data at higher frequencies. Why would a scientist opt to transmit data at a lower frequen
    12·1 answer
  • Travis just got promoted to network administrator after the previous administrator left rather abruptly. There are three new hir
    14·1 answer
  • Face book suggests Friends for users based on their
    13·1 answer
  • Brainly app won't let me watch ads anymore. I search my question and there is no skip button to watch an ad it only makes me buy
    7·2 answers
  • Hilarious error messages
    10·2 answers
  • Write a program that asks the user to enter a positive integer that represents a number in the decimal system and then displays
    12·1 answer
  • A company is completing research and development for software which it is planning to produce in approximately 2 years time. Whi
    7·1 answer
  • Ethics related to all <br> artificial intelligence?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!