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

  What is the minimum budget to index all pages

What is the minimum budget to index all pages? If you assume that each query can be answered by looking at data in just one partition.

  Write a program that creates an object of the production

Write a program that creates an object of the Production.Worker class and prompts the user to enter data for each of the object's data attributes.

  Identify four basic categories of security organizations

Discuss three broad categories of security and Identify four basic categories of security organizations

  What are the major phases of designing recursive algorithms

How does the space requirement for a recursive function relate to its recursion tree? What are the major phases of designing recursive algorithms?

  Discuss the conmcept of distributive bargaining

As a junior congress person you have been asked to help promote a bill to allow casino gambling in your state. There is much opposition to this bill.

  Analyze the general transition of us health laws based on

1.from the scenario differentiate between the concepts of criminal law antitrust and health care as they apply to

  What is the meaning of operator precedence

Depending on operator precedence, what values might be associated with the expression 6 + 2 * 3.

  Questiongenerate a time class which holds following

questiongenerate a time class which holds following information-hourminutesecondcreate a date class which holds the

  Accessing and reading a mouse

Accessing and reading a mouse

  How much dough mix and topping mix are leftover

Bryant's Pizza, Inc. is a producer of frozen pizza products. The company makes a net income of $1.00 for each regular pizza and $1.50 for each deluxe pizza produced. How much dough mix and topping mix are leftover

  Write a function to mirror an image vertically

Write a function to mirror an image vertically. Write a function to create a lightened gray scale image.

  What are prospect trends for healthcare informatics

What are prospect trends for healthcare informatics.

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