Comp Sci Final

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What will be printed by the code snippet? def subtract(A=20, B=15): return A-B print(subtract(12)) a) -3 b) 5 c) 3 d) 8

-3

What will be printed by the code snippet? def subtract(A=20, B=15): return A-B print(subtract(B=9)) a) 11 b) 5 c) 9 d) -6

11

What is the variance of the dataset? [3.8 8.9 1. 7. 0.8] A. 6.63 B. 9.37 C. 11.63 D. 12.96

12.96

What will be printed by the code snippet? x=lambda a : a + 10 print(x(5)) a) 15 b) 10 c) 5 d) "x(5)"

15

How many times will the print statement be called? fruits=["apple", "banana", "cherry"] for x in fruits: print(x) if x=="banana": break a) 2 b) 3 c) 4 d) 1

2

How many times will the print statement be called? i=1 while i<6: print(i) if i==3: break i+=1 a) 4 b) 3 c) 6 d) 1

3

How many times will the print statement be called? fruits=["apple", "banana", "cherry"] for x in fruits: print(x) a) 3 b) 4 c) 2 d) 1

3

What is the standard deviation of the dataset? [3.5 3.8 9.3 9.1 1.7] A. 3.9 B. 3.49 C. 2.1 D. 2.93

3.49

What is the median of the dataset? [4.6 5.5 2.9 0.2 7. ] A. 0.2 B. 7.0 C. 2.9 D. 4.6

4.6

How many times will the print statement be called? i=1 while i<6: print(i) i+=1 a) 5 b) 6 c) 7 d) 1

5

What is the mean of the dataset? [8.8 9.6 5. 0.6 5.6] A. 78.7 B. 33.9 C. 64.3 D. 5.9

5.9

What will be printed by the code snippet? def myfunc(n): return lambda a : a*n x = myfunc(4) print(x(15)) a) 60 b) 19 c) 45 d) 22

60

What will be printed by the code snippet? a=330 b=330 print("A") if a>b else print ("=") if a==b else print("B") a) A b) B c) = d) !=

=

An engineer is writing a piece of software to diagnose cancer patients. In the data, they notice that only 12 of the genetic markers seem to matter when determining a diagnosis. They then decide to write their program to only consider those 12 markers. This is an example of which pillar of computational thinking? a) Decomposition b) Abstraction c) Pattern Recognition d) Algorithms

Abstraction

Which pillar of computational thinking involves focusing on important information only and ignoring irrelevant details? a) Decomposition b) Pattern Recognition c) Abstraction d) Algorithms

Abstraction

An engineer is designing a new type of road surface. In addition to specifying the materials used and the dimensions of the surfaces, the engineer specifies a procedure that must be followed by the construction crew to ensure that the road surface is constructed correctly. This is an example of which pillar of computational thinking? a) Decomposition b) Pattern Recognition c) Abstraction d) Algorithms

Algorithms

Which pillar of computational thinking involves developing a step-by-step solution to the problem or the rules to solve the problem? a) Decomposition b) Pattern Recognition c) Abstraction d) Algorithms

Algorithms

Which type of Python operators are used with numeric values to perform common mathematical operations? a) Arithmetic b) Comparison c) Logical d) Bitwise

Arithmetic

Which type of Python operators are used to assign values to variables? a) Assignment b) Membership c) Logical d) Arithmetic

Assignment

A production facility is testing semiconductor devices. The goal of the test is to ensure that only "good" devices are sold to the customers and "defective" devices are thrown away. The yield of the manufacturing process (percentage of chips that are good) is known to be 0.79. The test procedure in the production facility can correctly identify defective devices 0.88 of the time. What is the probability of the test producing a Type I error? A. 0.12 B. 0.03 C. 0.34 D. 0.28

B

A production facility is testing semiconductor devices. The goal of the test is to ensure that only "good" devices are sold to the customers and "defective" devices are thrown away. The yield of the manufacturing process (percentage of chips that are good) is known to be 0.79. The test procedure in the production facility can correctly identify defective devices 0.88 of the time. What is the probability that a device will be of failing quality? A. 0.12 B. 0.21 C. 0.79 D. 0.88

B

An engineering firm is testing the rigidity of a new alloy to be used in the manufacturing of structural beams. They decide to test 150 beams made of the new alloy and find that they have an average rigidity of 50.4 with a sample standard deviation of 8.9. The previous alloy used by the firm had an average rigidity of 48.6. What is the standard deviation of the sampling distribution? A. 0.8938 B. 0.7267 C. 0.6395 D. 0.5523

B

An engineering firm is testing the rigidity of a new alloy to be used in the manufacturing of structural beams. They decide to test 150 beams made of the new alloy and find that they have an average rigidity of 50.4 with a sample standard deviation of 8.9. The previous alloy used by the firm had an average rigidity of 48.6. Which answer choice best represents the null hypothesis of the case study? A. The new alloy has a higher rigidity than the previous version. B. The new alloy has the same rigidity as the previous version. C. The new alloy has less rigidity than the previous version. D. The firm should keep using the previous version of the alloy.

B

What type of experiment has just two possible outcomes? A. Poisson B. Bernoulli C. Random D. Binomial

Bernoulli

A university wants to survey its students to see if enough tutoring is being provided. They decide to give the survey to students who made the Dean's List in the previous semester. Will this result in a biased or unbiased sample? A. Unbiased B. Biased

Biased

Which NumPy random function is used in the code sample? import numpy as np np.random. _ (n=10, p=0.5) print("Sample =", sample) Sample = 3 A. binomial B. random C. normal D. poisson

Binomial

Which type of Python operators are used to compare binary numbers? a) Bitwise b) Comparison c) Logical d) Arithmetic

Bitwise

Which Python datatype represents one of two values, true or false? a) Boolean b) Integer c) Float d) String

Boolean

Which Python datatype would be best for storing whether a student passed or failed an exam? a) Boolean b) Integer c) Float d) String

Boolean

A production facility is testing semiconductor devices. The goal of the test is to ensure that only "good" devices are sold to the customers and "defective" devices are thrown away. The yield of the manufacturing process (percentage of chips that are good) is known to be 0.79. The test procedure in the production facility can correctly identify defective devices 0.88 of the time. What is the probability of a device failing the test? A. 0.12 B. 0.21 C. 0.28 D. 0.72

C

A production facility is testing semiconductor devices. The goal of the test is to ensure that only "good" devices are sold to the customers and "defective" devices are thrown away. The yield of the manufacturing process (percentage of chips that are good) is known to be 0.79. The test procedure in the production facility can correctly identify defective devices 0.88 of the time. What is the probability of the test producing a Type II error? A. 0.28 B. 0.12 C. 0.34 D. 0.03

C

What is the z-statistic of the test performed on the alloy? A. 69.4 B. 66.9 C. 2.5 D. 0.2

C

Which type of Python operators are used to compare two values? a) Comparison b) Logical c) Membership d) Assignment

Comparison

A production facility is testing semiconductor devices. The goal of the test is to ensure that only "good" devices are sold to the customers and "defective" devices are thrown away. The yield of the manufacturing process (percentage of chips that are good) is known to be 0.79. The test procedure in the production facility can correctly identify defective devices 0.88 of the time. What is the probability of a device passing the test? A. 0.28 B. 0.88 C. 0.79 D. 0.72

D

An engineering team is developing an automated water filtration team. They divide the team into groups who will each focus on the filter itself, the power supply, the electronic controls, and the software engineering. This is an example of which pillar of computational thinking? a) Decomposition b) Pattern Recognition c) Abstraction d) Algorithms

Decomposition

Which pillar of computational thinking involves breaking down a complex problem or system into smaller, more manageable parts? . a) Decomposition b) Pattern Recognition c) Abstraction d) Algorithms

Decomposition

A Python list is not allowed to contain variables of different datatypes. a) True b) False

False

A Python set will allow duplicate values. a) True b) False

False

Which Python datatype is defined as a number, positive or negative, containing one or more decimals? a) Float b) Integer c) String d) Boolean

Float

Which type of Python operators are used to compare objects, not if they are equal, but if they are the same object with the same memory location? a) Identity b) Membership c) Logical d) Comparison

Identity

Which Python datatype is defined as a whole number, positive or negative, without decimals, of unlimited length? a) Integer b) Float c) String d) Boolean

Integer

What will be printed by the code snippet? class Person: def__init__(self, name, age): self.name = name self.age = age p1 = Person("John", 36) print(p1.name) a) John b) 36 c) Person d) p1.name

John

What will be printed by the code snippet? class Person: def__init__(self, fname, lname): self.firstname = fname self.lastname = lname def printname(self): print(self.firstname, self.lastname) x = Person("John", "Doe") x.printname( ) a) John Doe b) John c) Doe d) Person

John Doe

Which type of Python operators are used to combine conditional statements? a) Logical b) Comparison c) Bitwise d) Arithmetic

Logical

Which type of Python operators are used to test if a sequence is present in an object? a) Membership b) Bitwise c) Logical d) Comparison

Membership

Based on the results of the test, can the firm claim that the new alloy has a higher rigidity than the previously used alloy? A. No B. Yes

No

An engineer is tasked with determining why some devices fail and others do not. During testing, they notice that the majority of the devices fail when the ambient temperature is greater-than 90F or less-than 30F. This is an example of which pillar of computational thinking? a) Decomposition b) Pattern Recognition c) Abstraction d) Algorithms

Pattern Recognition

Which pillar of computational thinking involves looking for similarities within problems a) Decomposition b) Pattern Recognition c) Abstraction d) Algorithms

Pattern Recognition

Which statistical distribution is characterized by events which are completely independent of each other? A. Gaussian Distribution B. Poisson Distribution C. Normal Distribution D. Binomial Distribution

Poisson

Which Python library is being imported in the code sample? import as pkg pkg.set ( ) A. Seaborn B. NumPy C. Pandas D. Matplotlib

Seaborn

A local grocery store wants to find out the soda preference of their customers. They decide to survey 20 men and 20 women who shop in the store, regularly. What type of sampling is this? A. Simple Random Sampling B. Multistage Sampling C. Stratified Sampling D. Biased Sampling

Stratified Sampling

Which Python datatype uses single or double quotations to represent text data? a) String b) Integer c) Float d) Boolean

String

Which Python datatype would be best for storing a student's RNumber? a) String b) Integer c) Float d) Boolean

String

A Python dictionary is changeable. a) True b) False

True

A Python list is changeable. a) True b) False

True

A python tuple is ordered a) True b) False

True

The code snippet will print "b is greater than a" True or False a=33 b=200 if b>a: print("b is greater than a") else: print("a is greater than b"

True

A university wants to survey its students to see if courses are too difficult or too easy. They decide to give the survey to all students who enter the tutoring center during a one-month period. What type of sample will this result in? A. Simple Random Sample B. Stratified Sample C. Convenience Sample D. Voluntary Response Sample

Voluntary Response Sample

What will be printed by the code snippet? .def subtract(A, B): return A-B print(subtract(6, 4)) a) "2" b) "6" c) "4" d) "subtract(6, 4)"

a

What will be printed by the code snippet? a=200 b=33 if b>a: print("b is greater than a") elif a==b: print("a and b are equal") else: print ("a is greater than b") a) a is greater than b b) b is greater than a c) a and b are equal d) a and b are not equal

a is greater than b


Ensembles d'études connexes

Alternators and generator General text book

View Set

Chapter 1: The Rule of Law - Law in a Changing Communication Environment

View Set

Chapter 8: Assessment Techniques and the Clinical Setting

View Set

Week 4 - Understand the role of research in design, Explore UX research methods, Identify bias in UX research, Week 4 review, Course review -> NO QUIZ

View Set

ReadWorks | The Run [The Run Series, #1] ANSWER KEY

View Set

BUS COM C. 6 HW, Business Writing Chapter 6, BCOM Chapter 6, Chapter 6 BCOM 3950, BCOM Chapter 6

View Set

Chapter 43: Assessment of Digestive and Gastrointestinal Function

View Set