Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A Microelectroni x e Microelectron x RA Learning Mana X -Syllabus-EE x D sh syll

ID: 3757423 • Letter: A

Question

A Microelectroni x e Microelectron x RA Learning Mana X -Syllabus-EE x D sh syllabus.pdfx D Assignment 1 x zy Home-zyBool x zy 3.15. Program x + -e x C https://learn.zybooks.com/zybook/UMLEECE2160GeigerFall2018/chapter/3/section/15 History A Microelectronic Circ UMass Lowell UMa Other bookmarks zyBooks My library EECE 2160 home> 3.15: Program 3 A 1-Bit Boolean Calculator ezyBooks catalog Help/FAQ mohammed raji 3.15 Program 3: A 1-Bit Boolean Calculator 1. Introduction In this assignment, you will work with C conditional statements to implement a simple Boolean calculator program. This program will also introduce you to Boolean operators, which we will explore in much more detail later this semester Remember, in addition to submitting your code, you MUST complete the Blackboard assignment "Program 3 style assessment' to get all of the points for this program. You can complete this "assignment" by typing a short message indicating you submitted your code through the textbook IDE 2. Specification Input Specification 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), (OR).* (XOR), The prompt should read Enter Boolean expression: See the hints on Boolean operations described in this link for more details on these operators and their desired behavior. Example input expressions include the following (remember, your program must print the prompt "Enter Boolean expression:and then read the user input that follows): .Enter Boolean expression: 1 & 1 10:36

Explanation / Answer

#include <stdio.h>

int main() {

int a,b,c;

char str[100];

printf("Enter Boolean Expression ");

scanf("%s",str);

printf("%s ",str);

if(str[0]=='0')

a=0;

else

a=1;

if(str[2]=='0')

b=0;

else

b=1;

if(str[1]=='&')

c=a&b;

else if(str[1]=='|')

c=a|b;

else if(str[1]=='^')

c=a^b;

printf("%d",c);

return 0;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote