Write a c program for a mini calculator

Assignment Help Computer Engineering
Reference no: EM132196750

Write a C program for a mini calculator using only the command line options. You must use getopt to parse the command line.

Usage: minicalc [-a num] [-d num] [-m num] [-s num] [-e] value The variable value is the starting value.

• Value should be validated to be an integer between 1 and 99. Error message and usage shown if not.

• -a adds num to value. • -d divides value by num.

• -m multiplies value by num. • -s subtracts num from value.

• -e squares value. (Note: no num is needed.)

• Output should have exactly 2 decimal places no matter what the starting values are.

• If -e is included, it is executed first.

• Use standard order of operations for all operations.

Code should be nicely indented and commented.

Create a simple Makefile to compile your program into an executable called minicalc. You should submit the source code, your Makefile and a screenshot of the output file.

Reference no: EM132196750

Questions Cloud

Change should always be tested in the test environment : When configuring and testing a change in the environment, the change should always be tested in the "Test" environment.
What is the expenditure function : Preferences are modelled by an indirect utility function v(p1, p2, p3, y) = y p p1(p2 + p3) , where y denotes total breakfast spending and (p1, p2, p3).
Print out each command line argument on a separate line : Write a C program that will print out each command line argument on a separate line. However, you should print them out in reverse order.
What is the optimal output level : Is the current market level of production for this good socially optimal? If not, what is the optimal output level? Explain using a graph.
Write a c program for a mini calculator : Write a C program for a mini calculator using only the command line options. You must use getopt to parse the command line.
Consequences of overestimating verse underestimating demand : What are the consequences of overestimating verse underestimating demand?
Display the largest and second largest values : Write a C++ program that reads integers from a file on disk and then displays the largest and second largest values. You must use a C++ loop in this program.
Write a c program that uses splint and flags as many errors : Write a C program that uses splint and flags as many errors as possible from the list of all the errors shown : Dereferencing a possibly null pointer;
Determine which should be taxed more : If the government wants to raise a particular level of revenue in a way which minimises dead weight loss then should CRGs and RPGs be taxed similarly.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Explain the path a process

Explain the path a process might take through the five states specified in the five-state model discussed in the text?

  Ientify three key business requirements or needs that the

3. identify three key business requirements or needs that the system must meet of your selected

  Analyze the best algorithm for sorting an array

Provide the running time and pseudocode to analyze the best algorithm for sorting an array of n very very large numbers in the range 1 through n.

  Define word protocol and explain how it is used in computing

Define the word protocol and explain how it is used in computing. Distinguish between machine language and assembly language.

  Create and test an html document that has half page of text

Create and test an HTML document that has at least a half page of text and a small box of text embedded on the left margin, with the main text flowing around.

  How fulfilling a project managers responsibilities

Explain why and how each skill is useful in fulfilling a project manager's responsibilities

  You will be developing a human elements in it strategy

you will select a real or fictitious organization and apply your research to the development of a strategy that would

  How many times should we apply the filter for the color

How many times should we apply the filter for the color of the pixel at position (20, 20) to be influenced by the color at pixel (100, 100)?

  Compute the integer part of the quotient

Calculate an integer remainder when integer a is divided by integer b.

  Centre a map area on sydney

Javascript code to access the Google Maps Service in order to centre a map area on Sydney.

  How many exclusive-or operations are used in the des cipher

How many exclusive-or operations are used in the DES cipher? Why does the DES function need an expansion permutation?

  Write the polynomial method equals-difference

Write the Polynomial method equals_difference and integrate it into the calculator. Calculates a Polynomial object by multiplying p by the single Term t.

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