18.(4pts) Given the following values for the Boolean variables w, x, y and z: w=
ID: 3586945 • Letter: 1
Question
18.(4pts) Given the following values for the Boolean variables w, x, y and z: w= false , x= true, y= true, z = false Clearly indicate whether each logical expression is true or false. 19.(4 pts) Place the following statements in the proper order for correctly using file stream variables in a program. Place the numbers 1 through 4 on the line provided with 1 being the first step. Include the header file fstream on the hard drive with a file stream variable u function. Declare an identifier to be an input file stream or output file stream variable Use the file stream variable in a statement to write to a file or read from a file.Explanation / Answer
Explanation: Precedence is !(not), &&(and), ||(or)
First not will be done then with most close operands and will be done then comes the or.
a) !w is true and x is true. Hence it is true
b) w is false but !y and x are false. Hence it is false
c) !w is true, x is true, y or z is also true. Hence it is true.
d) y is true. Hence it is true
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.