Question: Error checking: Your program should print a descriptive error message under any of 1. Any cf the inputs are incorrectly formatted and therefore cannot be
Error checking: Your program should print a descriptive error message under any of 1. Any cf the inputs are incorrectly formatted and therefore cannot be read correcty Your error message should include the number of input values that 116 he condrions below. For examples of valid error messages, see Section 5: Test Cases: Programming Assignment #3: A 1-Bit Boolean Calculator Due Friday, 9/29/17, 11:59:59 PM 1. Introduction were entered correctly-for example: In this assignment, you will work with C condtional statements to implement a simple Error: 2 values entered correctly Boolean calculator program. This program will also introduce you to Boolean operators, which we will explore in much more detail later this semester. scant D returns the number of values correctly read, which you can store in a varlable to tost lator. Say you have the following ine of code: 2. Deliverables Submit your source file by uploading it directly to your Dropbox folder. Ensure your source file name is prog3 boolean.c. You should submit ony the c file. Falure to If the user enters: met his specifcation will reduce your grade, as descrbed in he program grading 1 2 a nVala --2 -(.a. is not part of a vaid int) . Is not part ofavald int, but 2 is 1.2 2 3 nvals-ar ( read cormrectly " 3. Specifications Input: Your program should prompt the user to enter a simple Boolean expression of the form a op b, where a and b are 1-bit operands and op is one of the following operators. (AND), I (OR), ^ 00R). See Section 6: Boolean Operations for more details on those operators and their desired behavior. Examples include: x1 2 3 nVala-- (*X'isnot part of a vald int) 2. Elther (or both) of the operands cannot be represented as a singlo bit (0 and 1 Your error message should print the invalid inputs) for example: are the only valid 1-bit values) - 1&1 Eerori firet inpat 13) requires r 1 bit 3 The operator entered is not a valid operator * Your error message should print the invalid operater -for example: Output: Given a valid he entire expression as well as its rosult For example, the expressions listed above will produce the folowing output: expression, your program should calculate the result and reprint NOTE: If the npts aro correctir formatted e-scant 1) can read al nut values, then your progrem may generate muliple error messagest For example, it the user enters the expression 3 x 4, then your program should print Beroz: Eszat input (3) requires > 1 bit NOTE: Your program should not pint the resuit of an expression if any ecror oocurs See the next page of the assignment for detals o Brrors ievalid operator x possible input errors it soantn cannot read all input values, your program should only print the emer meennge rolatod to a formating amor. For example, if ahe user enders the expression: x 3 4,then your program shouid prt See Section 5. Test Cases for more sample program runs Error checking: Your program should print a descriptive error message under any of 1. Any cf the inputs are incorrectly formatted and therefore cannot be read correcty Your error message should include the number of input values that 116 he condrions below. For examples of valid error messages, see Section 5: Test Cases: Programming Assignment #3: A 1-Bit Boolean Calculator Due Friday, 9/29/17, 11:59:59 PM 1. Introduction were entered correctly-for example: In this assignment, you will work with C condtional statements to implement a simple Error: 2 values entered correctly Boolean calculator program. This program will also introduce you to Boolean operators, which we will explore in much more detail later this semester. scant D returns the number of values correctly read, which you can store in a varlable to tost lator. Say you have the following ine of code: 2. Deliverables Submit your source file by uploading it directly to your Dropbox folder. Ensure your source file name is prog3 boolean.c. You should submit ony the c file. Falure to If the user enters: met his specifcation will reduce your grade, as descrbed in he program grading 1 2 a nVala --2 -(.a. is not part of a vaid int) . Is not part ofavald int, but 2 is 1.2 2 3 nvals-ar ( read cormrectly " 3. Specifications Input: Your program should prompt the user to enter a simple Boolean expression of the form a op b, where a and b are 1-bit operands and op is one of the following operators. (AND), I (OR), ^ 00R). See Section 6: Boolean Operations for more details on those operators and their desired behavior. Examples include: x1 2 3 nVala-- (*X'isnot part of a vald int) 2. Elther (or both) of the operands cannot be represented as a singlo bit (0 and 1 Your error message should print the invalid inputs) for example: are the only valid 1-bit values) - 1&1 Eerori firet inpat 13) requires r 1 bit 3 The operator entered is not a valid operator * Your error message should print the invalid operater -for example: Output: Given a valid he entire expression as well as its rosult For example, the expressions listed above will produce the folowing output: expression, your program should calculate the result and reprint NOTE: If the npts aro correctir formatted e-scant 1) can read al nut values, then your progrem may generate muliple error messagest For example, it the user enters the expression 3 x 4, then your program should print Beroz: Eszat input (3) requires > 1 bit NOTE: Your program should not pint the resuit of an expression if any ecror oocurs See the next page of the assignment for detals o Brrors ievalid operator x possible input errors it soantn cannot read all input values, your program should only print the emer meennge rolatod to a formating amor. For example, if ahe user enders the expression: x 3 4,then your program shouid prt See Section 5. Test Cases for more sample program runs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
