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
Svetllana [295]
2 years ago
6

Write a program that prints the question " Do youwant to continue? " and reads a user input. if the userinput is " Y ", " OK", o

r " Why not? ", printout " OK ". if the user input is "No " , then print out " Terminating ", Otherwise print " Bad input". The case of the user input should notmatter. For example, "y" or "yes" are also valid inputs. Write aclass YesNoChecker for this purpose.
Computers and Technology
1 answer:
Nataly_w [17]2 years ago
7 0

Answer:

#include <bits/stdc++.h>

using namespace std;

int main() {

   string in;//string in for taking input...

   cout<<"Do you want to continue ?"<<endl;

   getline(cin,in);//taking input from the user...

   if(in=="y"||in=="Y"||in=="yes"||in=="OK"||in=="Why not?")//conditions..

   cout<<"OK"<<endl;

   else if(in=="No")

   cout<<"terminating"<<endl;

   else

   cout<<"Bad input"<<endl;

return 0;

}

Explanation:

I have taken a string in.

Then taking input from user.

Checking the conditions using if else if ladder.

You might be interested in
Write a function named dice_eval that accepts two parameters representing numeric dice values and returns a string describing th
Zigmanuir [339]

Following are the "dice_eval" method code into python language.

Program Explanation:

  • Defining a method "dice_eval" that takes two variables "d1,d2" in its parametes.
  • Inside the method, multiple conditional statements were used that adds the parameter values and calculates its value which can be defined as follows:
  • In the if block, it adds the parameters and uses or gate that check its value that is equal to 7 or 11. so, it will return a string message that is 'Winner!'.  
  • In the elif block, it adds the parameters and uses or gate that check its value that is equal to 2 or 3 or 12. so, it will return a string message that is ' C r aps ! '.
  • In the else block, it uses a return keyword that adds parameter value and prints a string value.
  • Outside the method "d1,d2" is declared that inputs the value from the user-end, and passes the value into the method, and prints its value.

Program:

def dice_eval(d1, d2):#defining a method dice_eval that takes two parameters

if (d1+d2)==7 or (d1+d2)==11:#defining if block that adds parameter value and use or operator to check its value

return 'Winner!'#return string value

elif (d1+d2)==2 or (d1+d2)==3 or (d1+d2)==12:#defining elif block that adds parameter value and use or operator to check its value

return 'C r aps!'#return string value

else:#defining else block

return 'Point is '+str(d1+d2)#return string value with adding parameter

d1=int(input())#defining d1 that input value

d2=int(input())#defining d2 that input value

print(dice_eval(d1,d2))#calling method and print its return value

Output:

Please find the attached file

Please find the complete code in the attached file.

Learn more:

brainly.com/question/15011927

4 0
2 years ago
Jargon is:
pentagon [3]

Answer: The answer would be "B" - language that includes terms that only a select few can understand

Explanation:

3 0
2 years ago
Read 2 more answers
The security administrator for Corp wants to provide wireless access for employees as well as guests. Multiple wireless access p
Artemon [7]
It’s B I took the test
7 0
3 years ago
legacy application that has hard-coded static IP addresses and is running on an EC2 instance, what is the best failover solution
AlladinOne [14]

Answer:

Elastic IP address

Explanation:

Elastic IP addresses are static, persistent public IP addresses which can be associated and disassociated with the instance, as required.

This will provide the best failover solution that will keep same IP address on a new instance.

6 0
3 years ago
Please answer as soon as possible
kondaur [170]

its the first one x 3/14 bc 2/7 times 3/4 makes 6/28. 6/28 simplified is 3/14

8 0
3 years ago
Other questions:
  • Smart art can be used to create _____that highlights relationships betweeen two items
    8·2 answers
  • Why do we need IP Addresses in order for the Internet to function properly?
    7·1 answer
  • A store owner keeps a record of daily transactions in a text file. Each line contains three items: The invoice number, the cash
    7·1 answer
  • In the code segment below, assume that the int variable n has been properly declared and initialized. The code segment is intend
    5·1 answer
  • Introduction to Identity and Fitting In
    7·1 answer
  • Which search engine does not track users? Choose the answer.
    10·2 answers
  • Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee. A
    13·1 answer
  • is there a way to send files from my PC to my iPhone? My PC’s wifi receptors are broken so it cannot connect to wifi. Is there a
    6·1 answer
  • I can’t wait Till Miya’s anniversary skin To be released on september 21st
    6·1 answer
  • The _________________ creates international guiding principles for computer forensic examiners.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!