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
Elenna [48]
3 years ago
7

Create a script to input 2 numbers from the user. The script will then ask the user to perform a numerical calculation of additi

on, subtraction, multiplication, or division. Once the calculation is performed, the script will end.
Computers and Technology
1 answer:
ohaa [14]3 years ago
5 0

Answer:

The code given is written in C++

First we declare the variables to be used during the execution. The names given are self-explanatory.

Then the program outputs a request on the screen and waits for user input, for both numbers and one more time for the math operation wanted, selected with numbers 1 to 4.

Finally, the program executes the operation selected and outputs the result on screen.  

Code:

<em>#include <iostream> </em>

<em> int main() </em>

<em>{ </em>

<em> // variable declaration </em>

<em> float numberA; </em>

<em> float numberB; </em>

<em> int operation; </em>

<em> float result=0; </em>

<em> </em>

<em> //number request </em>

<em> std::cout<<"Type first number:\n"; std::cin>>numberA; </em>

<em> std::cout<<"Type second number:\n"; std::cin>>numberB; </em>

<em>  </em>

<em> //Operation selection </em>

<em> cout << "Select an operation\n"; </em>

<em> cout << "(1) Addition\n"; </em>

<em> cout << "(2) Subtraction\n"; </em>

<em> cout << "(3) Multiplication\n"; </em>

<em> cout << "(4) Division\n"; </em>

<em> std::cout<<"Operation:\n"; std::cin>>operation; </em>

<em> </em>

<em> switch(operation){ </em>

<em>  case 1: </em>

<em>   result = numberA+numberB; </em>

<em>   break; </em>

<em>  case 2: </em>

<em>   result = numberA-numberB; </em>

<em>   break; </em>

<em>  case 3: </em>

<em>   result = numberA*numberB; </em>

<em>   break; </em>

<em>  case 4: </em>

<em>   result = numberA/numberB; </em>

<em>   break;    </em>

<em>  default: </em>

<em>   std::cout<<"Incorrect option\n"; </em>

<em>  }</em>

<em> //Show result </em>

<em> std::cout<<"Result is:"<<result<<::std::endl; </em>

<em> return 0; </em>

<em>}</em>

You might be interested in
Explain Software licensing
lbvjy [14]

Answer:

Software Licensing is pretty much allowing another company to use your own product.

Explanation:

<u>For Example:</u>

<u>Company A</u> is working on a face swap application which requires a facial recognition software in order to work. They can either build one from scratch (which can take months) or they can pay someone who already has one in order to be able to use it.

<u>Company B</u> owns a facial recognition software and are asked by Company A to license their software to them. Company A pays Company B, they then draft up a contract for Company A allowing them to use the facial recognition app.

Software licenses are either proprietary, free, or open source. Proprietary is the one used in the example above.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

5 0
3 years ago
High quality pages in a task should all get the same Needs Met rating. For example, a high quality page for a common interpretat
marysya [2.9K]

Answer:

False

Explanation:

High quality page for a common interpretation always have different Needs Met rating than the high quality page for a minor interpretation of the query.

Although, both of this pages are of high quality we must differentiate the common from a minor interpretation of a query.

Needs Met should always know to place the high quality pages in a resolution hierarchy.

7 0
3 years ago
Who wrote the book of luke​
netineya [11]
Luke himself wrote t the book
5 0
3 years ago
If your computer system is not working correctly, you can use System Restore to return the ___________ ____________ to an earlie
Luden [163]

You can use System Restore to return the computer file history to an earlier point in time.

Explanation:

System Restore allows you to recover documents/files that may have been deleted if your computer is not operating as it should be. Therefore, the answer is "computer file history".


Hope this helps!

7 0
4 years ago
Suppose a group consists of 5 students. Three students are selected at random to do a presentation. How many different sets of p
Klio2033 [76]

Answer:

The number of presentation groups of 3 students that can be selected from a group of 5 students equals 10.

Explanation:

The number of different presenters equals the no of possible combinations of 3 students from a pool of 5 students.

Thus the number of possible combinations equals

\binom{5}{3}=\frac{5!}{(5-3)!\times 3!}=10

6 0
4 years ago
Other questions:
  • How does hardware differ from software
    9·1 answer
  • Which tab would you click to access the autosum feature?
    9·1 answer
  • Identify ways you can manage a project using project management software
    14·1 answer
  • How to create json object from variables javascript
    10·1 answer
  • People who score high on the Big Five trait dimension of ________ tend to use more adjectives in their e-mail communications. Gr
    15·1 answer
  • Write a program that asks the user for a word. Next, open up the movie reviews.txt file and examine every review one at a time.
    6·1 answer
  • 25 Points Asap <br> Write a Java program named Light.java that displays a light bulb shown below:
    14·1 answer
  • I AM GIVING BRAINLIEST!!!!!!! PLEASE HELP !!!!!!!!
    7·2 answers
  • Can someone help on number 8? Plz
    14·1 answer
  • Distributed databases and data warehouses would be considered which data model type?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!