Write a program which allows the user to perform simple task

Assignment Help C/C++ Programming
Reference no: EM13690941

Question. Write a program which allows the user to perform simple tasks on a calculator. A series of functions allows the user to select an operation to perform and then enter operands.

The first function displays a menu, giving the user the choice of typing in any one of the following:

+, -, *, /, or % representing the usual arithmetic operators

A representing the average of two numbers

X representing the maximum of two numbers

M representing the minimum of two numbers

S representing the square of a number

Q indicating the user wants to quit the program

The program reads the user's response into a variable of type char. Using a switch statement or a series of if statements, the program determines what function to call to process the user's request. For example, if the user enters +, another function asks for two integers. Then it finds the sum of the two integers. If the user enters X, a function asks for two integers and finds the larger of the two. If the user enters S, a function asks for one value and finds the square of that value. If the user enters Q, the program stops.

For each and every calculation performed, the program like the function prints the user's original input and the result.

Reference no: EM13690941

Questions Cloud

Perform the subsequent queries on the array : Use LINQ to select the PartDescription and Quantity and sort the results by Quantity - Use LINQ to select from each Invoice the PartDescription and the value of the Invoice.
How you format outputs that involve floating point : Discuss how you format outputs that involve floating point. Provide examples - Many programs require the use of an input mechanism to get data into the program and an output mechanism to present results and guidance.
Write a program that requires the number of bits : Write a program that requires the number of bits for the exponent and significant of a floating point representation, then requires two decimal real numbers and an operation, sum, subtraction or multiplication.
Write a program for fetching the content : Write a program for fetching the content of a web url and storing it into a file and most important thing write its j-unit test cases maximum 3 cases
Write a program which allows the user to perform simple task : Write a program which allows the user to perform simple tasks on a calculator. A series of functions allows the user to select an operation to perform and then enter operands.
Prove the equalities by induction : et S(n) = 1 + 2 + . . . n be the sum of the first n natural numbers and let C(n) = 1³ + 2³ + . . . n³ be the sum of the first n cubes - Prove the following equalities by induction on n, to arrive at the curious conclusion C(n) = S²(n) for every n. ..
Discuss the effects this kind of collaboration : Discuss the effects this kind of collaboration could have on business processes - Research commercial products (such as WebEx and LiveMeeting) available for this type of collaboration.
Describe which characteristic is most important : Suppose the characteristics of information (such as accuracy, completeness, timeliness, and relevancy) that are important to organizations. Describe which characteristic is most important for an organization with which you are familiar. Justify yo..
Describe your idea of the database : Imagine that you have been hired by a company to build a database for it and complete the following tasks - modeling of business requirements and understand the physical implementation of logical business models through the use of E-R models.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

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!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd