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 Python code to save the data to a MongoDB collection:Import json module to parse JSON dataImport MongoClient from pymongo
Zigmanuir [339]

Answer:

Explanation:

The objective of this task is to compute a program that involves the usage of Python code to save the data to MongoDB and to query  the database.

Due to the error that occur which makes me to be unable to submit this answer, I've created a word document instead and the attached file can be found below.

Thanks!

Download docx
8 0
2 years ago
A company ABC asked you to design a simple payroll program that calculates and employee's weekly gross pay, including any overti
julsineya [31]

Answer:

<em>C++.</em>

#include <iostream>

using namespace std;

////////////////////////////////////////////////////////////////

int main() {

   int weekly_hours = 0;

   int hourly_rate;

   float gross_pay = 0;

   cout<<"Enter weekly hours worked: ";

   cin>>weekly_hours;

   

   cout<<"Enter hourly rate: ";

   cin>>hourly_rate;

   

   cout<<endl;

   ////////////////////////////////////////////////

   if (weekly_hours > 40) {

       gross_pay = (weekly_hours*hourly_rate) + ((weekly_hours*hourly_rate)*0.5);

   }

   else

       gross_pay = weekly_hours*hourly_rate;

       

   cout<<"Weekly gross pay: $"<<gross_pay;

   ////////////////////////////////////////////////

   return 0;

}

3 0
2 years ago
What is true of softboxes?
gizmo_the_mogwai [7]
Softboxes have an umbrella on the front. The answer to your question is A. I hope that this is the answer that you were looking for and it has helped you.
4 0
3 years ago
Read 2 more answers
What considerations should you make when deciding on the size of a table?
Kisachek [45]

Answer:

You should consider the number of cells needed for data, labels, titles, and formulas.

Explanation:

4 0
2 years ago
A network administrator is examining a RIPv2 routing table and notices that several subnets are advertised in individual entries
Aleonysh [2.5K]

Answer:

B. Use the auto-summary command.

Explanation:

With the implementation of dynamic routing protocols, RIP summarizes networks at classful boundaries by default. To configure a router to automatically summarize networks, the auto-summary command would be used.

5 0
3 years ago
Other questions:
  • One of the disadvantages of cable technology is that:
    7·1 answer
  • The ________ multiple-selection PHP statement is used to handle decision making and can be used to replace multiple if and if...
    12·1 answer
  • Your friend sends you a photograph of his son. you want to enlarge the photograph. which program type will you use to make this
    15·1 answer
  • After reviewing the various types of network connections available, a client chooses a network connection that is considered to
    13·1 answer
  • What is the output of the following program? #include using namespace std; class TestClass { private: int val; void showVal() {
    5·1 answer
  • The customer's endpoint device on the wan is called the __________________.​
    11·1 answer
  • The _____ handles the instructions for your computer to start up before the operating system is loaded.
    10·1 answer
  • 19 dollar fortnite gift card
    14·2 answers
  • HELP ME?!!?!?!?!?!?
    9·2 answers
  • I really need help in this!!!
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!