Question: PLEASE INCLUDE FULL PROGRAM WITH INPUT AND OUTPUT REDIRECTION Programming In C Lab 3 B Objective To gain expertise in the use of repetition, character

PLEASE INCLUDE FULL PROGRAM WITH INPUT AND OUTPUT REDIRECTION
Programming In C
Lab 3B
Objective
To gain expertise in the use of repetition, character processing, functions, parameter passing, input/output
redirection and command line.
Assignment
Write a program to perform a simple arithmetic calculation. The user is to enter a simple expression - integer
operator integer - such as: 15+30
The program is to extract the 2 operands and the operator one character at a time, perform the indicated
calculation and display the result or print out an appropriate error message. For example: 15+30=45
Operators should include +-*/%
Operands are positive integers, no sign
Use getchar() function to read the expression
Use putchar() function to output the expression
Expression will have variable spacing before the first operand, between operator and operands and
after the second operand (zero, one or more spaces).
Your program needs to be in a loop asking whether the user wants to enter another expression with a
Y//N type of an answer (one character).
Code a function for each operator to do the appropriate operation (5 functions).
No global variables, arrays, string and/or character handling functions may be used in this lab.
Your program needs to generate an appropriate error message if the expression is invalid.
You may ONLY use getchar() and putchar() functions for reading and writing the expression. You may
use scanf() and printf() functions for user prompts, error messages, etc.
Input
One expression at a time with user prompts to repeat.
Output
The whole expression entered by the user EXACTLY as typed in (including spaces), the result or an appropriate
error message. Need to show all test cases and scenarios for valid and invalid expressions (there are many)
and how your program handled it.
Run
Create an input file of all valid and invalid expressions and answer to user prompts. Run the program on the
command line using input/output redirection:
Lab3b.exe lab3b_input.txt > lab3b_output.txt
Turn In
Turn in source code, input file and output file.
PLEASE INCLUDE FULL PROGRAM WITH INPUT AND OUTPUT

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!