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
Brrunno [24]
2 years ago
14

You will include code that will validate all user input. If the user inputs an invalid value, the program will respond with an e

rror message and will ask the user to input the data again (use a do / while loop). Invalid values include:
Computers and Technology
1 answer:
alukav5142 [94]2 years ago
8 0

Answer:

See explanation (Program written in C++)

Explanation:

The question is incomplete as the invalid values were not included in the question.

However, to make the sense of it, I'll answer your question using the following conditions.

1. Invalid values include: Numbers less than 0 (See comments for explanations)

#include <iostream>

using namespace std;

int main() {

//This line declares num (for user input)

int num;

//The following iteration keeps repeating itself until a number greater than 0 is entered using do while loop

do{

//This line prompts user for input

cout<<"Numbers greater than 0: ";

//This line gets input from the user

cin>>num;}

while(num<1);//This condition checks for valid user input

cout<<"You entered: "<<num; //This line prints out the user input

}

2. Invalid values include: Odd Numbers

I'll make use of the above code (in 1)

Start by replacing:

cout<<"Numbers greater than 0: ";

with

cout<<"Even Numbers: "; //This prompts user for even numbers

Replace

while(num<1);

with

while(num%2==1); //This checks if input is odd. If yes, the loop is repeated

3. Invalid values include: Even Numbers

I'll make use of the above code (in 1)

Start by replacing:

cout<<"Numbers greater than 0: ";

with

cout<<"Odd Numbers: "; //This prompts user for Odd numbers

Replace

while(num<1);

with

while(num%2==0); //This checks if input is even. If yes, the loop is repeated

You might be interested in
PLEASE HELP ASAP i will mark brilliant
Ray Of Light [21]
1. Cyberbullying
2.Confide in an adult you trust, such as a teacher or a parent
3.It is easy to miscommunicate  and escalate the situation in an online environment

Cyberbully hurts people, so NEVER post something that could hurt someone's feelings

Hope this helps!
3 0
3 years ago
Read 2 more answers
_____ assures the interface will act as the users expect, while _____ assures it will look pleasing. Select one:
Agata [3.3K]

Answer:

C. consistency, aesthetics

Explanation:

Based on the descriptions given to us in the question we can deduce that the answer is C. consistency, aesthetics. This is because "consistency" is defined as something that always delivers the same results, which is what users need from the interface in order to understand it and continue using it. While "aesthetics" is defined as the visual representation of something (how something will look).

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

7 0
3 years ago
​your business has a web server that has suddenly become unresponsive. when you study the server's logs there are a huge number
kvasek [131]
there's a chance the web server could quite possibly be backed up from all the requests and not being cleaned or updated often
8 0
2 years ago
Read 2 more answers
See if you can do better then I did
never [62]

Answer:

no i can't do better ggs

Explanation:

im not smart (also I did answer the question ;) )

8 0
2 years ago
Please
Andrew [12]

Answer:

C. 2^16

Explanation:

In Computer Networking, there are five (5) classes of IP addresses, these include;

- Class A

- Class B

- Class C

- Class D

- Class E

The various classes of IP address are represented by the value of their first octet. The first octet value of Class B is 128-191 with a subnet mask of 16.

Hence, from the IP address 149.130.x.y where x and y are 8-bit numbers. The x and y equals 16-bit numbers.

Thus, 2^16 devices can connect to the Wellesley network before we run out of IP addresses.

3 0
3 years ago
Other questions:
  • A dropped packet is often referred to as a _____________.
    7·1 answer
  • Which of the following are techniques that companies use to influence consumers demand for their goods and services
    7·2 answers
  • You can use the bash shell to redirect standard output or standard error from the terminal screen using the ____ shell metachara
    15·1 answer
  • Each computer on a network requires a unique way to identify itself and to refer to other computers. This is accomplished by usi
    8·1 answer
  • When using linear or reciprocal navigation, what should be the interface include?
    15·1 answer
  • Tell me the most scariest website you know and i'll give you brainlest
    5·1 answer
  • You are trying to connect a new USB device to your computer. You install the driver and then connect the device to an open USB
    10·1 answer
  • Laptop computers use PCMCIA cards, another type of ________
    15·1 answer
  • The User Datagram Protocol (UDP) is called the connectionless protocol because: It does not attempt to fix bad packets but resen
    8·1 answer
  • when demonstrating 2022 altima’s parking assistance, what steering feature should you mention when pointing out how easy the veh
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!