Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
The program reads two numbers and a character (operator). If the character is "+" then sum is displayed. If it is "-"then difference is displayed. If it is "*" then product is displayed. If it is "/" then quotient is displayed. Use a switch statement.
#include
using namespace std; int main ( )
{
int number1, number2, answer1,choice; float answer2;
/* menu of operation*/
cout<<"Menu of Operations"< cout<<"2 Division "< cout<<"3 Addition "< cout<<"4 Subtraction "< /*end of menu*/
cout<<"enter the two integer numbers: "<>number1>>number2;
cout<<"enter your choice: "< cin>>choice;
/* make use of the switch case construct to make decisions*/
switch (choice)
case 1:
answer1= number1 * number2;
cout< case 2: answer2= number1 / number2; cout< case 3: answer1= number1 + number2; cout< case 4: answer1= number1 - number2; cout< default: cout<<"invalid operator"< } return 0; }
case 2:
answer2= number1 / number2;
cout< case 3: answer1= number1 + number2; cout< case 4: answer1= number1 - number2; cout< default: cout<<"invalid operator"< } return 0; }
case 3:
answer1= number1 + number2;
cout< case 4: answer1= number1 - number2; cout< default: cout<<"invalid operator"< } return 0; }
case 4:
answer1= number1 - number2;
cout< default: cout<<"invalid operator"< } return 0; }
default:
cout<<"invalid operator"< } return 0; }
}
return 0;
Syntax rules for writing constructor functions Its name must be similar as that of the class to which it belongs. It is declared with no return type (not even void). Ho
decoding message
Programming an odds betting website Project Description: We want someone to program a odds betting website, Require someone with experience and skills! Skills required are
#question write a prog c & cpp
i am using otlv4 for database connecttvity, while i try to get all tables list from current database using query "$SQLTables" no output is displayed though programe compiles coretl
Implementation of the Definition class: void Definition::put_word(char *s) { word = new char[strlen(s)+1]; strcpy(word,s); nmeanings = 0; } voi
Program of function overloading: class vector{ private : int v[3]; public: /*friend istream &
Question : (a) What is a structure? Provide a simple example of your own to illustrate this feature. (b) How does a structure differ from an array? (c) Describe a structu
limitation of linear array
Input Format: First line starts with T, which is the number of test cases. Each test case contains a string (S). Output Format: For each test case print the minimum number of ch
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd