CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152...
Transcript of CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152...
![Page 1: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/1.jpg)
CS 152Computer Programming
FundamentalsQuiz 7
Brooke Chenoweth
University of New Mexico
Spring 2020
![Page 2: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/2.jpg)
Question 1Which is the best variable declaration for thenumber of people in your family?
A boolean foo;
B boolean familyMemberCount = 1;
C int familyMemberCount = 1;
D float familyMemberCount = 1;
E double familyMemberCount = 1;
![Page 3: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/3.jpg)
Question 1Which is the best variable declaration for thenumber of people in your family?
A boolean foo;
B boolean familyMemberCount = 1;
C int familyMemberCount = 1;
D float familyMemberCount = 1;
E double familyMemberCount = 1;
![Page 4: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/4.jpg)
Question 2
public class TestClass {
public static void main(String [] args) {
int x = 5;
int y = 10;
y = y - x / 2;
System.out.println(y);
}
}
8
![Page 5: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/5.jpg)
Question 2
public class TestClass {
public static void main(String [] args) {
int x = 5;
int y = 10;
y = y - x / 2;
System.out.println(y);
}
}
8
![Page 6: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/6.jpg)
Question 3
public static void main(String [] args) {
int n = 92;
int a = n / 25;
n = n % 25;
int b=n / 10;
n = n % 10;
System.out.println(a);
System.out.println(b);
System.out.println(n);
}
n 92
a 3
b 1
![Page 7: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/7.jpg)
Question 3
public static void main(String [] args) {
int n = 92;
int a = n / 25;
n = n % 25;
int b=n / 10;
n = n % 10;
System.out.println(a);
System.out.println(b);
System.out.println(n);
}
n 92
a 3
b 1
![Page 8: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/8.jpg)
Question 3
public static void main(String [] args) {
int n = 92;
int a = n / 25;
n = n % 25;
int b=n / 10;
n = n % 10;
System.out.println(a);
System.out.println(b);
System.out.println(n);
}
n 17
a 3
b 1
![Page 9: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/9.jpg)
Question 3
public static void main(String [] args) {
int n = 92;
int a = n / 25;
n = n % 25;
int b=n / 10;
n = n % 10;
System.out.println(a);
System.out.println(b);
System.out.println(n);
}
n 17
a 3
b 1
![Page 10: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/10.jpg)
Question 3
public static void main(String [] args) {
int n = 92;
int a = n / 25;
n = n % 25;
int b=n / 10;
n = n % 10;
System.out.println(a);
System.out.println(b);
System.out.println(n);
}
n 7
a 3
b 1
![Page 11: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/11.jpg)
Question 3
public static void main(String [] args) {
int n = 92;
int a = n / 25;
n = n % 25;
int b=n / 10;
n = n % 10;
System.out.println(a);
System.out.println(b);
System.out.println(n);
}
n 7
a 3
b 1
3
1
7
![Page 12: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/12.jpg)
Question 4Which of the following is not part of all loops?
A initialization
B loop body
C termination condition
D the keyword “while”
![Page 13: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/13.jpg)
Question 4Which of the following is not part of all loops?
A initialization
B loop body
C termination condition
D the keyword “while”
![Page 14: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/14.jpg)
Question 5What is the output of the following code?
public static void main(String [] args) {
int n = 10;
int z = n-1;
while (z > 1) {
if ((n % z) != 0) {
System.out.print(z +", ");
}
z--;
}
}
9, 8, 7, 6, 4, 3,
![Page 15: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/15.jpg)
Question 5What is the output of the following code?
public static void main(String [] args) {
int n = 10;
int z = n-1;
while (z > 1) {
if ((n % z) != 0) {
System.out.print(z +", ");
}
z--;
}
}
9,
8, 7, 6, 4, 3,
![Page 16: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/16.jpg)
Question 5What is the output of the following code?
public static void main(String [] args) {
int n = 10;
int z = n-1;
while (z > 1) {
if ((n % z) != 0) {
System.out.print(z +", ");
}
z--;
}
}
9, 8,
7, 6, 4, 3,
![Page 17: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/17.jpg)
Question 5What is the output of the following code?
public static void main(String [] args) {
int n = 10;
int z = n-1;
while (z > 1) {
if ((n % z) != 0) {
System.out.print(z +", ");
}
z--;
}
}
9, 8, 7,
6, 4, 3,
![Page 18: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/18.jpg)
Question 5What is the output of the following code?
public static void main(String [] args) {
int n = 10;
int z = n-1;
while (z > 1) {
if ((n % z) != 0) {
System.out.print(z +", ");
}
z--;
}
}
9, 8, 7, 6,
4, 3,
![Page 19: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/19.jpg)
Question 5What is the output of the following code?
public static void main(String [] args) {
int n = 10;
int z = n-1;
while (z > 1) {
if ((n % z) != 0) {
System.out.print(z +", ");
}
z--;
}
}
9, 8, 7, 6, 4,
3,
![Page 20: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/20.jpg)
Question 5What is the output of the following code?
public static void main(String [] args) {
int n = 10;
int z = n-1;
while (z > 1) {
if ((n % z) != 0) {
System.out.print(z +", ");
}
z--;
}
}
9, 8, 7, 6, 4, 3,
![Page 21: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/21.jpg)
Question 6What is the output of the following code?
public static void main(String [] args) {
int a = 4;
for (int i=a*a; i > 1; i -= 5) {
System.out.print("(" + i + "," + a + ") ");
}
System.out.println ();
}
(16,4) (11,4) (6,4)
![Page 22: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/22.jpg)
Question 6What is the output of the following code?
public static void main(String [] args) {
int a = 4;
for (int i=a*a; i > 1; i -= 5) {
System.out.print("(" + i + "," + a + ") ");
}
System.out.println ();
}
(16,4)
(11,4) (6,4)
![Page 23: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/23.jpg)
Question 6What is the output of the following code?
public static void main(String [] args) {
int a = 4;
for (int i=a*a; i > 1; i -= 5) {
System.out.print("(" + i + "," + a + ") ");
}
System.out.println ();
}
(16,4) (11,4)
(6,4)
![Page 24: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/24.jpg)
Question 6What is the output of the following code?
public static void main(String [] args) {
int a = 4;
for (int i=a*a; i > 1; i -= 5) {
System.out.print("(" + i + "," + a + ") ");
}
System.out.println ();
}
(16,4) (11,4) (6,4)
![Page 25: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/25.jpg)
Question 7What is the best type to store the following?
The value of the square root of 3
• boolean
• double
• int
• Random
• Scanner
• String
![Page 26: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/26.jpg)
Question 7What is the best type to store the following?
The value of the square root of 3
• boolean
• double
• int
• Random
• Scanner
• String
![Page 27: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/27.jpg)
Question 7What is the best type to store the following?
The current state of a light switch (on or off)
• boolean
• double
• int
• Random
• Scanner
• String
![Page 28: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/28.jpg)
Question 7What is the best type to store the following?
The current state of a light switch (on or off)
• boolean
• double
• int
• Random
• Scanner
• String
![Page 29: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/29.jpg)
Question 7What is the best type to store the following?
The number of adults in a household
• boolean
• double
• int
• Random
• Scanner
• String
![Page 30: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/30.jpg)
Question 7What is the best type to store the following?
The number of adults in a household
• boolean
• double
• int
• Random
• Scanner
• String
![Page 31: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/31.jpg)
Question 7What is the best type to store the following?
The result of a coin flip
• boolean
• double
• int
• Random
• Scanner
• String
![Page 32: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/32.jpg)
Question 7What is the best type to store the following?
The result of a coin flip
• boolean
• double
• int
• Random
• Scanner
• String
![Page 33: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/33.jpg)
Question 7What is the best type to store the following?
The title of a movie
• boolean
• double
• int
• Random
• Scanner
• String
![Page 34: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/34.jpg)
Question 7What is the best type to store the following?
The title of a movie
• boolean
• double
• int
• Random
• Scanner
• String
![Page 35: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/35.jpg)
Question 8Which code would you use to create an array thatcould hold 50 String objects?
A Strings names = new String(50);
B String names = new String[50];
C String names[50];
D String[50] names;
E String[50] names = new String();
F String[] names = new String;
G String[] names = new String[50];
H String[] names = new String(50);
I String[] names = new [String](50);
![Page 36: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/36.jpg)
Question 8Which code would you use to create an array thatcould hold 50 String objects?
A Strings names = new String(50);
B String names = new String[50];
C String names[50];
D String[50] names;
E String[50] names = new String();
F String[] names = new String;
G String[] names = new String[50];
H String[] names = new String(50);
I String[] names = new [String](50);
![Page 37: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/37.jpg)
Question 9
boolean apple = true;
boolean orange = false;
boolean banana = true;
boolean kiwi = false;
apple && orange
![Page 38: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/38.jpg)
Question 9
boolean apple = true;
boolean orange = false;
boolean banana = true;
boolean kiwi = false;
apple && orange false
![Page 39: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/39.jpg)
Question 9
boolean apple = true;
boolean orange = false;
boolean banana = true;
boolean kiwi = false;
apple || orange || banana
![Page 40: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/40.jpg)
Question 9
boolean apple = true;
boolean orange = false;
boolean banana = true;
boolean kiwi = false;
apple || orange || banana true
![Page 41: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/41.jpg)
Question 9
boolean apple = true;
boolean orange = false;
boolean banana = true;
boolean kiwi = false;
!kiwi
![Page 42: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/42.jpg)
Question 9
boolean apple = true;
boolean orange = false;
boolean banana = true;
boolean kiwi = false;
!kiwi true
![Page 43: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/43.jpg)
Question 9
boolean apple = true;
boolean orange = false;
boolean banana = true;
boolean kiwi = false;
(apple || kiwi) && (orange || kiwi)
![Page 44: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/44.jpg)
Question 9
boolean apple = true;
boolean orange = false;
boolean banana = true;
boolean kiwi = false;
(apple || kiwi) && (orange || kiwi) false
![Page 45: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/45.jpg)
Question 9
boolean apple = true;
boolean orange = false;
boolean banana = true;
boolean kiwi = false;
!apple && (!orange || banana || kiwi)
![Page 46: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/46.jpg)
Question 9
boolean apple = true;
boolean orange = false;
boolean banana = true;
boolean kiwi = false;
!apple && (!orange || banana || kiwi) false
![Page 47: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/47.jpg)
Question 9
boolean apple = true;
boolean orange = false;
boolean banana = true;
boolean kiwi = false;
!apple || (!orange || banana || kiwi)
![Page 48: CS 152 Computer Programming Fundamentals Quiz 7bchenoweth/cs152/cs152lecture20-quiz7.… · CS 152 Computer Programming Fundamentals Quiz 7 Brooke Chenoweth University of New Mexico](https://reader033.fdocuments.in/reader033/viewer/2022053003/5f0756ea7e708231d41c7eea/html5/thumbnails/48.jpg)
Question 9
boolean apple = true;
boolean orange = false;
boolean banana = true;
boolean kiwi = false;
!apple || (!orange || banana || kiwi) true