Question
C++
10:19 AM Tue Oct 9 csive csicuny edu le. Original 3_1 Boolean and A&&B&&c and AllBIIC in a table with 3 columns Hand in HW #4 36 pts Read study SECs 3.1-3.3 1. Evaluate the following conditional expressions (T or F). 4 pts 2. FLOWCHART THE FOLLOWING (condensed) CODE in et int main) 8 PTS ( int number; cout <Enter an integer:; cin >>number if ( number>0) cout <You entered a positive integer:< number < endl; else if (number <0) cout<You entered a negative integer:< number <<endl; else cout <<You entered 0. << endl cout << When is this tine printed?!logical operators. return 0; ) 3 Setiun at tahle like helow and Cnmnlete the triuth tahle 16 nts A&&IB A11IB A & B IB &1B false false false true true false true true 4. In C++, the and #-operators perform identical operations and may be used interchangeably. True or False 1 pt 5.Expalin what type of operator for Each. (logical, arithmetic, relational, unary, binary HAND IN LABORATORY TASK: LAB #9 v.3/2/1 Write a program that inputs the values of three Boolean variables, a, b, and c, from a cin operator (user gives the values be sure to prompt user for what the have to give!). Then the program determines the value of the
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

a. F

13 > 6

b. F

(7 > 9) is false and 6!= 5 is true but whole expression is false as && is true if both conditions are true.

c.T

4< 3 is false but 4 >= 0 is true so with || the result is true

d. F

('F' <'M') is true so its negation is false

2. Flowchart

Start Enter an integer number true f number>0/Print You entered a positive integer false true Print You entered a negative integer If number <0 alse When is this line printed? Print You entered o Stop

3.

A B A&&!B A||!B !A&B !A&!B
false false false true false true
false true false false true false
true false true true false false
true true false true false false

4. False

= is assignment operator used to assign a value or variable to a variable whereas == is comparison operator used to compare two expressions

5.

A. ! ---- >logical , unary

B. == -----> relational,binary

C. % -----> arithmetic,binary

D. != ----> relational , binary

E. ( ----> arithmetic, unary

F. ++ ---> arithmetic ,unary

G. && ----> logical, binary

Do ask if any doubt. Please upvote.

Add a comment
Know the answer?
Add Answer to:
C++ 10:19 AM Tue Oct 9 csive csicuny edu le. Original 3_1 Boolean and A&&B&&c and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • c++, I am having trouble getting my program to compile, any help would be appreciated. #include...

    c++, I am having trouble getting my program to compile, any help would be appreciated. #include <iostream> #include <string> #include <string.h> #include <fstream> #include <stdlib.h> using namespace std; struct record { char artist[50]; char title[50]; char year[50]; }; class CD { //private members declared private: string artist; //asks for string string title; // asks for string int yearReleased; //asks for integer //public members declared public: CD(); CD(string,string,int); void setArtist(string); void setTitle(string); void setYearReleased(int); string getArtist() const; string getTitle() const; int...

  • I am having trouble with my C++ program.... Directions: In this lab assignment, you are to...

    I am having trouble with my C++ program.... Directions: In this lab assignment, you are to write a class IntegerSet that represents a set of integers (by definition, a set contains no duplicates). This ADT must be implemented as a singly linked list of integers (with no tail reference and no dummy head node), but it need not be sorted. The IntegerSet class should have two data fields: the cardinality (size) of the set, and the head reference to the...

  • #include<iostream> using namespace std; int main() { float num,avg,sum=0.0; int count=0; bool moreNumbers=true; cout<<"Enter grades:"<<endl; while(moreNumbers)...

    #include<iostream> using namespace std; int main() { float num,avg,sum=0.0; int count=0; bool moreNumbers=true; cout<<"Enter grades:"<<endl; while(moreNumbers) { cin>>num; if(num < 0) { moreNumbers=false; } else { count = count+1; sum=sum+num; } } avg=sum/count; cout<<"Average grade:"<<avg<<endl; cout<<"How many grades were entered:"<<count<<endl; return 0; } Question: We need to add another loop to check input. Just like the input loop we already have, this one should use a boolean variable as a control. So, the logic could be something like this: Loop...

  • QUESTION 1 What is the output of the following code snippet? int main() { bool attendance...

    QUESTION 1 What is the output of the following code snippet? int main() { bool attendance = false; string str = "Unknown"; attendance = !(attendance); if (!attendance) { str = "False"; } if (attendance) { attendance = false; } if (attendance) { str = "True"; } else { str = "Maybe"; } cout << str << endl; return 0; } False True Unknown Maybe QUESTION 2 What is the output of the following code snippet? #include <iostream> #include <string> using...

  • Help with C++ reverse program with leading zeros. I need to put the line from the...

    Help with C++ reverse program with leading zeros. I need to put the line from the function that display the zeros in main not in the function. So how can I move the display with leading zeros in main. Thanks. Here is my code. #include <iostream> #include <cstdlib> #include <iostream> using std::cout; using std::cin; using std::endl; //function templates int reverseNum(int); int main() { //variables char buf[100]; int num; while (true) { //prompt user for input cout << "Enter the number...

  • Write a C/C++ program that simulate a menu based binary number calculator. This calculate shall have the following three...

    Write a C/C++ program that simulate a menu based binary number calculator. This calculate shall have the following three functionalities: Covert a binary string to corresponding positive integers Convert a positive integer to its binary representation Add two binary numbers, both numbers are represented as a string of 0s and 1s To reduce student work load, a start file CSCIProjOneHandout.cpp is given. In this file, the structure of the program has been established. The students only need to implement the...

  • Hello, I am working on a C++ pick 5 lottery game that gives you the option...

    Hello, I am working on a C++ pick 5 lottery game that gives you the option to play over and over. I have everything working right except that every time the game runs it generates the same winning numbers. I know this is an srand or rand problem, (at least I think it is), but I can't figure out what my mistake is. I've tried moving srand out of the loop, but I'm still getting the same random numbers every...

  • Hello, I am working on a project for my C++ class, I have the vast majority...

    Hello, I am working on a project for my C++ class, I have the vast majority of the code figured out but am running into a few issues. Mainly updating each * to an X. The problem is as follows:(Airplane Seating Assignment) Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with six seats in each row. Rows 1 and 2 are first class, rows 3 through 7 are business...

  • im writing a c++ code and getting stuck on two parts. The first part, when I...

    im writing a c++ code and getting stuck on two parts. The first part, when I go to write the customer order out to the file, it writes everything but the price out right. I'll get a weird number like 5.95828e-039 or nan. When I printout to the console it works fine so not sure what's wrong. Second After I write the order out to the file, I then have to go in and read the file and calculate the...

  • Program is in C++, program is called airplane reservation. It is suppose to display a screen...

    Program is in C++, program is called airplane reservation. It is suppose to display a screen of seating chart in the format 1 A B C D E F through 10. I had a hard time giving the seats a letter value. It displays a correct screen but when I reserve a new seat the string seats[][] doesn't update to having a X for that seat. Also there is a file for the struct called systemUser.txt it has 4 users...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT