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]
3 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]3 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
Which device stores data only temporarily, and only when the computer is running?
Artist 52 [7]
1. C) RAM

2. C) CPU

3. B) Accounts Payable

I believe these are the correct answers you are looking for.

8 0
4 years ago
To add the word "confidential" to the background of a page, users would need to _____.
KengaRu [80]
I beleive you need to insert a watermark
3 0
3 years ago
A Windows computer is experiencing a problem accessing the Internet. The network patch cable and network interface card have bee
Svet_ta [14]

Answer:

The next step to consider is updating the system's network settings

Explanation:

The next step after testing and verifying that the network patch cable and network interface card are working is to update the network settings to recent configurations.

Updating the system's network include settings of network adapter, LAN / Wi-Fi and TCP/IP.

Looking into your network settings is one of steps of effectively troubleshooting a system's network.

Few settings you could update are

1. LAN settings

2. TCP/IP network protocol properties

3. Network adapter settings

4. Internet connection

Effectively, updating the network settings is the next step. Few things to take note of when updating the network settings are

1. Create Standard Configurations for Device Classifications

2. Maintain the Current and Previous Network Configurations

3. Keep Track of Changes

4. Lastly, Document Network Changes

8 0
4 years ago
Alison is having a hard time at work because her Inbox is flooded with emails every day. Some of these emails are unsolicited. S
fredd [130]

Answer:

1.c 2.a

Explanation:

If the new emails she doesn't need could be ignored in spam. the old ones are useless so trash em.

5 0
4 years ago
Read 2 more answers
What is the small window that pops up in a application that requieres a response for the user
Marina CMI [18]

Answer:

that is called a popup box. or a alert box

assuming you are talking about this

3 0
3 years ago
Read 2 more answers
Other questions:
  • An agile team used planning poker to estimate user stories. After all team members read a user story, the facilitator asks every
    7·1 answer
  • What is an efficiency target? Give an example of setting an efficiency target
    11·1 answer
  • Boardman College maintains two files—one for Sociology majors and another for Anthropology majors. Each file contains students'
    5·1 answer
  • Grading on the curve is a method of grading that is based on the belief that letter grades for any given class should be distrib
    8·1 answer
  • Describe a situation in which you have experienced harm as a consequence of a failure of computer security. Was the failure mali
    6·1 answer
  • What is data mining?1) A particular attribute of information 2) The common term for the representation of multidimensional infor
    10·1 answer
  • What is software? what are two types of software?​
    6·1 answer
  • Define application software​
    12·1 answer
  • Animations<br> Animations are !<br> Blank which can be Applied to blank in a presentation?
    7·1 answer
  • Which option identifies the type of engineers described in the following scenario?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!