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
gladu [14]
3 years ago
8

Write a C++ program to build a simple calculator(+،-،*،/) using switch statement?​

Computers and Technology
1 answer:
Mars2501 [29]3 years ago
4 0

Answer:

Check explanation

Explanation:

# include <iostream>

using namespace std;

int main()

{

   char op;

   float a, b;

   cout << "Enter operator either + or - or * or /: ";

   cin >> op;

   cout << "Enter two operands: ";

   cin >> num1 >> num2;

   switch(op)

   {

       case '+':

           cout << a + b;

           break;

       case '-':

           cout << a - b;

           break;

       case '*':

           cout << a * b;

           break;

       case '/':

           cout << a / b;

           break;

       default:

           cout << "This operator is not valid. Please try again.";

           break;

   }

   return 0;

}

You might be interested in
Screen reader software is an example of a(n) ____.
s2008m [1.1K]
<span>It is an example of an assistive output device. These are an example of assistive technology, which is any technology optimized to help the user mitigate the aspects of a disability. This may enable them to use the technology as intended, or it may also assist them in functioning in their everyday lives.</span>
3 0
3 years ago
If you code a column list in an INSERT statement that includes a column that’s defined with a default value, you can insert the
Vinvika [58]

Answer:

If you code a column list in an INSERT statement that includes a column that’s defined with a default value, you can insert the default value for that column by coding the DEFAULT keyword in the VALUES clause of the INSERT statement.

Explanation:

SQL permits insert the DEFAULT value on the columns when is required. Suppose the column has a NULL constraint(values on this column can not be set in null), then you can pass the default value.

For example:

INSERT INTO table(field1, field2, field3, field4) VALUES (10, DEFAULT, 20, DEFAULT)

6 0
3 years ago
In g.o.o.g.l.e sheet Columns are labeled by ____​
telo118 [61]

Answer:

Explanation:

Click the Data option.

Click on Named Range. This will open the 'Named ranges' pane on the right.

Click on the 'Add a range' option.

Enter the name you want to give the column (“Sales” in this example)

Make sure the column range is correct. ...

Click on Done.

3 0
2 years ago
Roger is part of a team that is responsible for employing a new information system, the design of which was developed using cust
antoniya [11.8K]

Answer:

A line with a diamond on one end

Explanation:

A line with a diamond on one end is used as a symbol for condition.

In a structured programming chart, condition represents the fact that one program module (a control module) determines subordinate modules that will be invoked.

5 0
4 years ago
What is the output of the following code fragment? int i = 1; int sum = 0; while (i &lt;= 11) { sum = sum + i; i++; } System.out
valentina_108 [34]

Answer:

The value of sum is 66

Explanation:

i = 1

sum = 0

while (i <= 11) {  

sum = sum + i;

i++;  

}

i = 1

  • sum = sum + i
  • sum = 0 + 1
  • sum = 1

i = 2

  • sum = sum + i
  • sum = 1 + 2
  • sum = 3

i = 3

  • sum = sum + i
  • sum = 3 + 3
  • sum = 6

i = 4

  • sum = sum + i
  • sum = 6 + 4
  • sum = 10

i = 5

  • sum = sum + i
  • sum = 10 + 5
  • sum = 15

i = 6

  • sum = sum + i
  • sum = 15 + 6
  • sum = 21

i = 7

  • sum = sum + i
  • sum = 21 + 7
  • sum = 28

i = 8

  • sum = sum + i
  • sum = 28 + 8
  • sum = 36

i = 9

  • sum = sum + i
  • sum = 36 + 9
  • sum = 45

i = 10

  • sum = sum + i
  • sum = 45 + 10
  • sum = 55

i = 11

  • sum = sum + i
  • sum = 55 + 11
  • sum = 66

i = 12 --> does not comply with the condition "i < = 11", the while loop is over

7 0
3 years ago
Other questions:
  • The second row of letters on the keyboard is called the______ row
    14·2 answers
  • You use Cat5e twisted pair cable on your network. Cables are routed through walls and the ceiling. A user puts a screw in the wa
    9·1 answer
  • What information should be included in the closing paragraph of a thank-you letter? a. Mention skills that were omitted during t
    6·2 answers
  • What does IP stand for (as in IP address)? Also, what is overtype mode?
    6·1 answer
  • Publishing is copying Web pages and associated files to a Web<br> server. T or f
    12·1 answer
  • What is the purpose of the Excel Function Reference?
    9·1 answer
  • 9. Which is an example of a function?<br>(1 Point)<br>=A1 +A2<br>=SUM(A1:A3)<br>=ADD(A1:A3)​
    14·2 answers
  • What is the importance of effectiveness in communication?
    14·1 answer
  • In the context of the data administration component of a database management system (DBMS), the acronym CRUD stands for _____.
    5·1 answer
  • Which of the following best describes your sequence of actions when developing a web page?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!