CIS74 Midterm Fall 2022

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

How do you select an element with id 'demo'? #demo demo *demo .demo

#demo

Which button class is used to create a large button? .btn-xl .btn-large .btn-lg

.btn-lg

How do you select an element with id 'demo'? #demo demo *demo .demo

.demo

Which class is used to create a vertical navigation bar? .navbar .navbar-vertical .navbar navbar-vertical

.navbar

Which class shapes an image to a circle? .img-round .rounded-circle .img-rounded .img-circle

.rounded-circle

How do you select elements with class name 'test'? .test *test test #test

.test

Which contextual class is used to create an orange text color? .text-warning .bg-warning .txt-orange

.text-warning

How many stacks are needed to implement a queue. Consider the situation where no other data structure like arrays, linked list is available to you. 2 1 3 4

2

The minimum number of fields with each node of doubly linked list is 3 2 1 4

2 ( not correct) according to exam

What is the correct HTML for adding a background color? <body style="background-color:yellow;"> <body bg="yellow"> <background>yellow</background>

<body style="background-color:yellow;">

What is the correct HTML element for inserting a line break? <break> <br> <lb>

<br>

Choose the correct HTML element for the largest heading: <h1> <h6> <head>

<h1>

A standard navigation bar is created with: <nav class="navbar navbar-default"> <nav class="navbar navbar-expand-sm"> <nav class="nav navbar">

<nav class="navbar navbar-expand-sm">

Choose the correct HTML element to define important text <b> <strong> <i> <important>

<strong>

A standard navigation tab is created with: <ul class="nav nav-tabs"> <ul class="navigation-tabs"> <ul class="nav nav-navbar">

<ul class="nav nav-tabs">

Which of the following points is/are true about Linked List data structure when it is compared with array Arrays have better cache locality that can make them better in terms of performance All mentioned It is easy to insert and delete elements in Linked List Random access is not allowed in a typical implementation of Linked Lists The size of array has to be pre-decided, linked lists can change their size any time

All of the above

The seven elements A, B, C, D, E, F, and G are pushed onto a stack in reverse order, i.e., starting from G. The stack is popped five times and each element is inserted into a queue. Two elements are deleted from the queue and pushed back onto the stack. Now, one element is popped from the stack. The popped item is ________. B A F G

B

Which component is used to cycle through elements, like a slideshow? Slideshow Carousel Scrollspy

Carousel

The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four items and each element is inserted in a queue. The two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is D A B C

D

Which one of the following is an application of Stack Data Structure? All mentioned Arithmetic expression evaluation The stock span problem Managing function calls

D All of the above

TRUE or FALSE psutil.net_if_addrs() Return information about each NIC (network interface carterm-8d) installed on the system as a dictionary whose keys are the NIC names and value is a named tuple with the following fields: isup: a bool indicating whether the NIC is up and running (meaning ethernet cable or Wi-Fi is connected). duplex: the duplex communication type; it can be either NIC_DUPLEX_FULL, NIC_DUPLEX_HALF or NIC_DUPLEX_UNKNOWN. term-13 speed: the NIC speed expressed in mega bits (MB), if it can't be determined (e.g. 'localhost') it will be set to 0. mtu: NIC's maximum transmission unit expressed in bytes.

False

The .container class provides a full width container, spanning the entire width of the screen True False

False

When using the padding property; are you allowed to use negative values? True False

False

psutil.net_if_addrs() Return information about each NIC (network interface card) installed on the system as a dictionary whose keys are the NIC names and value is a named tuple with the following fields: isup: a bool indicating whether the NIC is up and running (meaning ethernet cable or Wi-Fi is connected). duplex: the duplex communication type; it can be either NIC_DUPLEX_FULL, NIC_DUPLEX_HALF or NIC_DUPLEX_UNKNOWN. speed: the NIC speed expressed in mega bits (MB), if it can't be determined (e.g. 'localhost') it will be set to 0. mtu: NIC's maximum transmission unit expressed in bytes. True False

False

What does HTML stand for? Hyper Text Markup Language Hyperlinks and Text Markup Language Home Tool Markup Language

Hyper Text Markup Language

Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity? Merge Sort Insertion Sort Quick Sort Heap Sort

Merge sort

What is the worst-case time complexity of inserting n elements into an empty linked list, if the linked list needs to be maintained in sorted order? O(n squared) O(n) O(n log n) O(1)

O(n squared)

The time required to search an element in a linked list of length n is O(n squared) O(n) O(log n) O(1)

O(n)

How do you group selectors? Separate each selector with a comma Separate each selector with a plus sign Separate each selector with a space

Separate each selector with a comma

Who is making the Web standards? Microsoft The World Wide Web Consortium Google Mozilla

The World Wide Web Consortium

What do hash functions do? They transform keys into array indexes They make sure the items will be evenly distributed in the array They insert the values according to the keys

They transform keys into array indexes

What is the following function performing: def check_cpu_usage(): usage=psutil.cpu_percent(1) return usage < 75 We'll check the usage for a whole second. We'll say the machine is healthy if a cpu_usage is less than 75 percent. We'll check the usage for a whole minute. We'll say the machine is healthy if a cpu_usage is less than 75 percent.

We'll check the usage for a whole second. We'll say the machine is healthy if a cpu_usage is less than 75 percent.

How do you display hyperlinks without an underline? a {text-decoration:none;} a {underline:none;} a {decoration:no-underline;} a {decoration:no-underline;}

a {text-decoration:none;}

multiple answered question

answered toward the end of the flashcards

How do you display a border like this: The top border = 10 pixels The bottom border = 5 pixels The left border = 20 pixels The right border = 1pixel? border-width:10px 1px 5px 20px; border-width:10px 5px 20px 1px; border-width:5px 20px 10px 1px; border-width:10px 20px 5px 1px;

border-width:10px 1px 5px 20px;

Which attribute is used to create a tooltip? data-toggle="popup" data-toggle="tooltip" data-toggle="collapse" data-toggle="modal"

data-toggle="tooltip"

Select the correct code snippet that defines a check_disk_usage function that will receive a disk check and return true if there's more than 20 percent free or false if it's less. def check_disk_usage(disk): du=shutil.disk_usage(disk) free=du.free/du.total*100 return free < 20 def check_disk_usage(disk): du=shutil.disk_usage(disk) free=du.free/du.total*100 return free > 20

def check_disk_usage(disk): du = shutil.disk_usage(disk) free = du.free/du.total* 100 return free > 20

Select the correct code snippet that defines a check_disk_usage function that will receive a disk check and return true if there's more than 20 percent free or false if it's less. def check_disk_usage(disk): du=shutil.disk_usage(disk) free=du.free/du.total*100 return free < 20 def check_disk_usage(disk): du=shutil.disk_usage(disk) free=du.free/du.total*100 return free > 20

def check_disk_usage(disk): du=shutil.disk_usage(disk) free=du.free/du.total*100 return free > 20

How do you select all p elements inside a div element? div p div.p div + p

div p

How do you select all p elements inside a div element? div p div.p div + p

div p

Which statement opens a file in read-only binary mode? files = open('my_file.txt', 'b+') files = open('my_file.txt', 'b') files = open('my_file.txt', 'rb') files = open('my_file.txt', 'r+b')

files = open('my_file.txt', 'rb')

Which property is used to change the font of an element? font-family font-weight font-style

font-family

Which CSS property controls the text size? font-size text-style text-size font-style

font-size

How do you make the text bold? font-weight:bold; style:bold; font:bold;

font-weight:bold;

Identify the loop that prints the names of the directories, subdirectories, and files in a path/ for dirname, subdirs, files in os.path(path): print(dirname, subdirs, files) for files in os.path(path): print(files) for dirname in os.walk(path): print(dirname[0], dirname[1], dirname[2] for dirname, subdirs, files in os.walk(path): print(dirname, subdirs, files)

for dirname, subdirs, files in os.walk(path): print(dirname, subdirs, files)

Consider the following my_script.py. Which statement should replace XXX in the script for the command-line argument python my_script.py input.txt ? import sys import os if len(sys.argv) != 2: print('Usage: {} inputfile'.format(sys.argv[0])) sys.exit(1) print('Opening file {}...'.format(sys.argv[1])) XXX print('Oh No! The file does not exist.') sys.exit(1) if not os.path.exist(sys.argv[1]): if os.path.exists(sys.argv[2]): if os.path.exists(sys.argv[1]): if not os.path.exists(sys.argv[1]):

if not os.path.exists(sys.argv[1]):

Consider the following my_script.py. Which statement should term-62replace XXX in the script for the command-line argument python my_script.py input.txt ? import sys import os if len(sys.argv) != 2: print('Usage: {} inputfile '.format(sys.argv[0])) sys.exit(1) print('Opening file {}...'.format(sys.argv[1])) XXX print('Oh No! The file does not exist.') sys.exit(1) if not os.path.exist(sys.argv[1]): if os.path.exists(sys.argv[2]): if os.path.exists(sys.argv[1]): if not os.path.exists(sys.argv[1]):

if not os.path.exists(sys.argv[1]):

How do you make a list that lists its items with squares? list-style-type: square; list: square; list-type: square;

list-style-type: square;

Which property is used to change the left margin of an element? margin-left padding-left indent

margin-left

Which of the following methods from the os module will create a new directory? mkdir() chdir() path.isdir() listdir()

mkdir()

Which of the following methods from the os module will create a new directory? mkdir() chdir() path.isdir() listdir()

mkdir()

Which is the correct suntax for opening a file in Python? my_file = readlines('Wikipedia_data.txt') my_file = read('Wikipedia_data.txt') my_file = open('Wikipedia_data.txt') my_file = open_text('Wikipedia_data.txt')

my_file = open('Wikipedia_data.txt')

Which is the correct syntax for opening a file in Python? my_file = readlines('Wikipedia_data.txt') my_file = read('Wikipedia_data.txt') my_file = open('Wikipedia_data.txt') my_file = open_text('Wikipedia_data.txt')

my_file = open('Wikipedia_data.txt')

What is the correct CSS syntax for making all the <p> elements bold? p {font-weight:bold;} <p style="text-size:bold;"> <p style="font-size:bold;"> p {text-size:bold;}

p {font-weight:bold;}

Which library do you use to find disk usage? shutil psutil

psutil

Select the correct answer: ______is the method that returns the addresses associated with each NIC(network interface card) installed on the system as a dictionary whose key are the NIC names and value is a list of named tuples for each address assigned to the NIC. psutil.net_if_addrs() psutil.net_addrs() pcutil.network_address() shutil.net_if_addrs()

psutil.net_if_addrs()

Select the correct answer: ______ is the method that returns stats about system memory usage as a named tuple, including fields such as total (total physical memory available), available(available memory, i.e. not used), used, and percent (i.e. percentage). psutil.virtual_memory() platform.virtual_memory() psutil.virtualMemory() shutil.virtual_memory()

psutil.vertual_memory()

Select the correct answer: ------- is the method that returns stats about system memory usage as a named tuple, including fields such as total (total physical memory available), available (available memory, i.e not used), used, and percent (i.e percentage). psutil.virtual_memory() platform.virtual_memory() psutil.virtualMemory() shutil.virtual_memory()

psutil.virtual_memory()

What is the default value of the position property? static absolute relative fixed

static

to get the installed software list in windows We will use the ___ module to interact with cmd and retrieve information into you Python IDE. process subprocess psutil platform

subprocess

How do you make each word in a text start with a capital letter? text-transform:capitalize You can't do that with CSS transform:capitalize text-style:capitalize

text-transform:capitalize

multiple answer question

will be answered in the back


संबंधित स्टडी सेट्स

CH 10 Membrane Structure: Lipid Bilayer

View Set

Personality Psychology: Exam 1 Study Set

View Set

Chapter 24. Human Origins and Evolution

View Set