Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Write a C program that runs on ocelot 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.The Makefile should be called Makefile with no extension. I should be able to type make at the command line to compile your program.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions