Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ent sso the CS 2433 C/C++ Programming - Programming assignment 3 Due date and time 11:59 PM, February 8, 2030 Poblem Write a program, med

image text in transcribed
ent sso the CS 2433 C/C++ Programming - Programming assignment 3 Due date and time 11:59 PM, February 8, 2030 Poblem Write a program, med p3.c.that behaves in the manner describe in the message listed below, either printing the usage m e when the t w is help, or accepting input from stdin You should write a m e stdout in more whether and c li c k or overflow or unrecognized input The reason for this a c t is to learn to deal with C , as well as to learn something about C-type string functies These d e t codecer the core of the operating i O S and services. This will contine in programming which will be the assignment. Use of way to implement simple stack is to f l y her than with Naming Your wh i le is to be named p3.c Output: Your program's put mest be to stdout and of one of the formats following assuming argenarge the wa ter for and where arograms argv[0). andr is yra number in decimal format Ifargv[1] is help. display the following Usage: programma programlama --help display this usage material. programa postfix" The program accepts input from standard input as a sequence of numbers and operators. The numbers (operands, as integers or floating point numbers) read are pushed on a stack until needed. When an operator is read, the required operands are popped from the stack and used to perfon the calculation, with the result placed on the stack, valid operators are .,- ..and I. are interpreted as addition, subtraction, multiplication and division, respectively, as described below. An additional operator is, which indicates that the value at the top of the stack is popped from the stack and displayed along with the number of values remaining on the stack, whereupon the program terminates. stack underflows generate an error message and halt the program, as do a stack Overflows. Unrecognized input tokens produce error messages and result in program termination, as do unrecognized command line arguments. The size of the stack Stack operations are performed as indicated here. puscoopopo oh popo- teme: push(popo popQ2 1 item. 3. Popo push Coope r ate as the result with the number of itens remaining on the stack The above describes the majority of the behavior of the program you to write Terre and expand important points If the first command-line argument is help. subsequent command lineaments are ered, the usage message is displayed and the program termine the first and line argument is postfix. w m inerents are p e nd the program proceeds with reading from standard input Invalid recognized command-line mens produce aw e co display the usage information above, and terminate the program If an n i red token is read from standard input, a suitable comm e for the type of error is to be displayed with the usage text and the program terminated Ifall inputs are recognized and no cr i se, print the following to stdout

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_2

Step: 3

blur-text-image_3

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

Students also viewed these Databases questions