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
frosja888 [35]
3 years ago
8

Write an application that asks a user to type an even number or the sentinel value 999 to stop. When the user types an even numb

er, display the message "Good job!" and then ask for another input. When the user types an odd number, display an error message, "x is not an even number", and then ask for another input. When the user types the sentinel value 999, end the program
Computers and Technology
2 answers:
Alisiya [41]3 years ago
6 0

Answer:

int value;

while(1){

scanf("%d\n", &value);

if(value == 999)

break;

if(value%2 == 0)

printf("Good job");

else if(value%2 == 1)

printf("%d is not an even number", value);

}

Explanation:

I am going to write a C code for this.

The while(1) runs until the break command. So

int value;

while(1){

scanf("%d\n", &value);

if(value == 999)

break;

if(value%2 == 0)

printf("Good job");

else if(value%2 == 1)

printf("%d is not an even number", value);

}

yan [13]3 years ago
3 0

Answer:

 do{

    std::cout << "input an even number: ";

    std::cin >> n;

    even=n%2;

    if (even==0)

    std::cout << "Good job!\n";

    else

    std::cout << n <<" is not an even number\n";

    }while(n!=999);

Explanation:

#include <iostream>

#include <string>

int main()

{ int n=0,even;

 do{

    std::cout << "input an even number: ";  //print on screen to input the number

    std::cin >> n;  //put that value on n variable

    even=n%2;

    if (even==0)  //if even is zero the number is even

    std::cout << "Good job!\n";

    else  //if even is not zero the number is odd

    std::cout << n <<" is not an even number\n";

    }while(n!=999);  // we will repeat the proccess while n is diffrente from 999

}

You might be interested in
To create a chart you need to select at least ___ in a range of data
Blababa [14]

Answer:

2 by 2 squares of data

Explanation:

If you have less than that it is not a chart.

5 0
3 years ago
Select one of the following strategies: active listening, sandwich technique, constructive feedback. in 2-5 paragraphs, define a
Neporo4naja [7]

Answer:

Active listening is used to make things more clear when talking to other people. Whether it is on the phone or face to face active listening can reduce any unwanted barriers of communication. Getting rid of barriers can help a company save time rather than trying to explain things multiple times. This ultimately would lead to more goods or services being produced therefore making the company more efficient. There are many more reasons why this workplace tacit is useful but I personally believe this is one of the more used ways.

I really hope this works for you!

5 0
3 years ago
If a storm is 7.5 kilometers away, how much time is expected between observations of lightning and thunder? Round your answer to
Svetlanka [38]

Answer:

22.5 s is the correct answer to the given question .

Explanation:

Given that

d=7.5km=7.5\times 10^3 m

For light:

We know that speed of light c

c=3\times 10^8 m/s

We know that

Distance = Speed \times timed=C\time tt=\dfrac{D}{t}t=\dfrac{7.5\times 10^3}{3\times 10^8}\ st=2.5\times 10^{-5}st=0.025 ms

For thunder :

Speed of sound ,v=332 m/s

Time\  taken\  by\  sound \\t\’=\dfrac{7500}{332}=22.59 s

Therefore the difference between time is given as follows

\Delta t= t' - \ t=22.59-2.5\times 10^{-5}=22.59 s

22.5 is the answer

4 0
3 years ago
Write a code segment that takes an emailaddress stored in the string email and stores theuser name in the string user and the ho
iragen [17]

Answer:

#include <bits/stdc++.h>

using namespace std;

int main() {

  string email,username,host;//strings to store email,username,hostname..

  cout<<"Enter the email address "<<endl;

  cin>>email;//taking input of email address..

  bool flag=1;

  for(int i=0;i<email.length();i++)//iterating over the string email..

  {

      if(email[i]=='@')//if @ symbol is encountered make flag 0 skip this iteration.

      {

          flag=0;

          continue;

      }

      if(flag==1)//add to username if flag is 1.

      {

          username+=email[i];

      }

      else//add tom host..

      host+=email[i];

  }

  cout<<"The username is "<<username<<endl<<"The host name is "<<host;//printing the username and hostname..

return 0;

}

Explanation:

I have taken  three strings to store the email address entered by user ,username and host to store username and host name respectively.Then I am iterating over the string email if @ is encountered then skip that iteration before that keep adding characters to username string and after that keep adding characters to host.

8 0
3 years ago
One advantage of a resource like the World Wide Web is that it connects people with problems to people who have__
Nezavi [6.7K]

Answer:

Answers

Explanation:

5 0
3 years ago
Other questions:
  • You should structure the<br> first before you search for a relevant picture.
    11·1 answer
  • This type of software works with end users, application software, and computer hardware to handle the majority of technical deta
    12·1 answer
  • The small company where you work needs to implement a second server for its accounting system, but does not have the funds to pu
    11·1 answer
  • Using the Vigenere cipher, does the length of the key matter?
    8·1 answer
  • A ddr4 dimm with a pc rating of pc4-17000 is running at what speed?
    15·1 answer
  • The rules of right-of-way<br> Pedestrians, bicyclists, and skateboarders<br> when they use the road.
    12·1 answer
  • Different between desktop application and web application ?​
    9·1 answer
  • Outline four types of cyber law.
    14·1 answer
  • A ____ is a share of ownership in a company
    11·2 answers
  • How do you modify WordArt? Give specific details and steps<br><br> NEED THIS ASAP
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!