Chapter 1
1000 name tags are to be sorted by last name by first placing tags into 26 unsorted sub-stacks (for A's, B's, etc.), then sorting each sub-stack. When sorting each sub-stack, suppose the time to insert a name tag into the appropriate location of a sorted N-item sub-stack is N * 0.1 sec. If the largest sub-stack is 50 tags, what is the longest time to insert a tag?
5 sec
Suppose the time to insert a name tag into an N-item stack is N * 0.1 sec. How many seconds are required to insert a name tag into the appropriate location of a 500 item stack?
50 sec
101100 has ___ bits.
6
Assuming y is 3 and z is 5, Indicate with what value x is assigned. If appropriate, type: Error x = y + z
8
Assuming y is 3 and z is 5, Indicate with what value x is assigned. If appropriate, type: Error x =y+z
8
Character
A letter (a, b, ..., z, A, B, ..., Z), symbol (!, @, #, ...), or single-digit number (0, 1, ..., 9). Basically, each item on a keyboard is a character (though more characters exist). Each character can be given a unique bit code.
Variable
A name that can hold a value
Bit
A single 0 or 1 is called a bit.
Statement
A specific action in a program.
A 0 or 1 is called a ___.
Bit
web developers
Build websites, which may involve the look/feel, the content, the performance of the site, and more. Web development is a rapidly evolving field, with many technologies created to make web development more efficient.
Eight bits are called a ____.
Byte
Interestingly, the above list is dominated by jobs in what two general areas?
Computing, and health care
String literal
Consists of text (characters) within double quotes, as in "Go #57!".
Software developers
Create, design, and program software. Software developers often have a firm understanding of available technologies for building software.
Problem solving
Creating a methodical solution to a given task.
Today
Earlier room-sized computers could fit on a pinhead-sized chip
1970's
Earlier room-sized computers could fit on one coin-sized computer chip.
1920's
Engineers configured telephone switches to do simple calculations like adding two numbers.
1960's
Engineers could put multiple switches on a single chip. U.S. moon rocket program brought dramatically improved chips and decreased prices.
A computer systems analyst mainly does what?
Evaluates and improves computer systems
An online shopping site allows setting up automated repeat purchases. A person needs to determine the rate for laundry detergent. One bottle does 64 loads. He does a load a week. His wife does a load a week. His daughter does a load every two weeks. What's the best rate?
Every 24 weeks
What's wrong with this survey question? How many minutes did you spend?__ Under 5__ 6 or more
Exactly 5 minutes is not a choice
1940's
First computers; occupied entire rooms.
Information Security Analysts
Focus on protecting an organization's computers and data. Increasingly important as "hackers" continue to steal huge amounts of data, as widely-publicized in recent years. Information security analysts learn the weaknesses of computers in order to protect the computers and data.
Computer Support Specialists
Likely requires both a strong knowledge of computer technology, and excellent interpersonal skills due to dealing with non-technical users. Computer support specialists may share with software developers particular program features and interfaces that confuse users.
What one factor was used to rank the best jobs?
Multiple factors were considered
Which instruction completes the program to compute a triangle's area? base = Get next input height = Get next input Assign x with base * height Put x to output
Multiply by 1/2
Suppose an email message has 500 characters. How many bits would a computer use to store that email, using ASCII code?
3500
1000 name tags are to be sorted by last name by first placing tags into 26 unsorted sub-stacks (for A's, B's, etc.), then sorting each sub-stack. If last names are equally distributed among the alphabet, what is the largest number of name tags in any one sub-stack?
39
An organizer of a 64-person meeting wants to start by having every person individually greet every other person for 30 seconds. Indicate whether the proposed solution achieves the goal, without using excessive time. Form an inner circle of 32, and an outer circle of 32, with people matched up. Every 30 seconds, have the outer circle shift left one position.
No
An organizer of a 64-person meeting wants to start by having every person individually greet every other person for 30 seconds. Indicate whether the proposed solution achieves the goal, without using excessive time. Have everyone form a line. Have the first person greet the other 63 people for 30 seconds each. Then have the second person greet each other person for 30 seconds each (skipping anyone already met). And so on.
No
An organizer of a 64-person meeting wants to start by having every person individually greet every other person for 30 seconds. Indicate whether the proposed solution achieves the goal, without using excessive time. Have everyone form a line. Then have everyone greet the person behind them.
No
An organizer of a 64-person meeting wants to start by having every person individually greet every other person for 30 seconds. Indicate whether the proposed solution achieves the goal, without using excessive time. Pair everyone randomly. Every 30 seconds, tell everyone to find someone new to greet. Do this 63 times.
No
Indicate which items in a program are string literals. Have a nice day
No
Which type of computer is more popular?
Smartphones
Program execution begins at the _____ node.
Start
Industrial age
Starting in the late 1700's transformed civilization towards manufacturing goods, leading to mass migration to cities, creation of strong nations, world wars, doubling of lifespans and thus dramatic world population growth
For many thousands of years, most humans lived as farmers.
True
If sock type A is pulled first, sock type B second, and sock type C third, the fourth sock type must match one of A, B, or C.
True
Modern cars contain computers.
True
The industrial age has led to steep population growth.
True
The number of embedded computers are greater than the number of desktops and laptop computers.
True
// *** Careful!!! Tricky calculation below ***
Valid comment
// Below computes temperature.
Valid comment
// Determine total //
Valid comment
// Initialize sum with 0 before adding// the input values with one another sum = 0
Valid comment
A program has statement x = Get next input followed by y = Get next input. If the program's input is 22 and 77, then:
X gets 22, y gets 77
Program
a list of statements, each statement carrying out some action and executing one at a time.
Output statement
a parallelogram represents, Written as: Put item to output.
ASCII
a popular code for character
Newline
a special two-character sequence \n whose appearance in an output string literal causes the cursor to move to the next output line. The newline exists invisibly in the output.
Which statement assigns variable numCars with the next input value?
numCars = Get next input
Whitespace
refers to blank spaces (space and tab characters) between items within a statement, and to newlines. Whitespace helps improve readability for humans, but for execution purposes is mostly ignored.
Interpreter
runs a program's statements
Run and execute
words for carrying out a program's statements.
Indicate the output of each output statement. Put How are you? to output
(error)
What is the 7-bit code for a lower-case 'a'?
1100001
What is binary number 1100 as a decimal number?
12
Flowchart
a graphical language for creating computer programs
What is the 7-bit code for a blank space?
0100000
What is 7 as a 4-bit binary number?
0111
1000 name tags are to be sorted by last name by first placing tags into 26 unsorted sub-stacks (for A's, B's, etc.), then sorting each sub-stack. Suppose the time to place an item into one of the 26 sub-stacks is 1 second. How many seconds are required to place all 1000 name tags onto a sub-stack?
1000 sec
Byte
1011 is four bits. Eight bits, like 11000101, are called a byte.
An embedded computer is a computer inside a personal computer such as a desktop or laptop.
False
For most people, programming comes easy.
False
If socks are pulled one at a time and kept until a match is found, at least four pulls are necessary.
False
If socks are pulled two at a time and put back if not matching, and the process repeated until the two pulled socks match, the maximum number of pulls is 4.
False
Society's transformation due to computers is nearly complete.
False
Software developers spend nearly all their time alone at a computer
False
The information age has covered about 100 years.
False
The number of desktop computers continue to rise each year.
False
Indicate the output of each output statement. Put "Hello friend!" to output
Hello friend!
Computer Systems Analysts
Help organizations use computing technology to operate effectively. Requires strong combination of business and computing technology knowledge. Computer systems analysts also help organizations operate more efficiently.
Computer programmers
Help write programs created by software developers. Computer programmers may write code in multiple computer languages on a daily basis.
What two-letter word does this sequence of bits represents in ASCII?
Hi
input statement
In zyFlowchart, a parallelogram represents an input statement, written as: variable = Get next input. (A parallelogram also represents an output statement, described below). The input statement assigns the indicated variable with the next program input value.
Cursor
Indicates where the next output item will be placed in the output. The system automatically moves the cursor after the previously-output item.
/ Get time from user
Invalid comment
What shape is used for an input statement?
Parallelogram
Given variable numCars = 9, which statement outputs 9?
Put numCars to output
Type a statement that outputs the value of numUsers (a variable).
Put numUsers to output
A program's statements execute _____.
Sequentially
Computational thinking
The thought processes needed to build correct, precise, logical programs
Moore's Law
The trend of switch sizes halving about every two years.
Indicate the output of each output statement. Put "To be" to outputPut "or not to be" to output
To beor not to be
An organizer of a 64-person meeting wants to start by having every person individually greet every other person for 30 seconds. Indicate whether the proposed solution achieves the goal, without using excessive time. Form two lines of 32 each, with attendees matched up. Every 30 seconds, have one line shift left one position (with the person on the left end wrapping to right). Once the person that started on the left is back on the left, then have each line split into two matched lines, and repeat until each line has just 1 person.
Yes
Indicate which items in a program are string literals. "Hello" "Hello!@#$%" "Oh my" " " "56"
Yes
Indicate the output of each output statement. Put "a\nb\nc" to output
a b c
Which instruction completes the program to compute the average of three numbers? x = Get next input y = Get next input z = Get next input Put a to output
a = (x + y + z) /3
Embedded computer
a computer inside another electrical device, like inside a TV, car, printer, thermostat, satellite, etc. Thus, beyond business and personal computing devices like PCs, tablets, and smartphones, computers exist invisibly in nearly anything electrical today too.
Decimal numbers
base ten numbers
Binary numbers
base two numbers
Information age
began in the 1990's, with human activity shifting from traditional industry to creating/managing/using computerized information. In just those few years, how people work, learn, communicate, or entertain themselves has already changed dramatically, but the ultimate impact on civilization likely remains to be seen.
Assuming y is 3 and z is 5, Indicate with what value x is assigned. If appropriate, type: Error num Cars = 2 5
error
Assuming y is 3 and z is 5, Indicate with what value x is assigned. If appropriate, type: Error x = y= + z
error
character
includes any letter (a-z, A-Z), digit (0-9), or symbol (~, !, @, etc.).
Each rectangle or parallelogram contains one _____.
statement
Comment
text a programmer adds to a program, to be read by humans to better understand the code, but ignored by the program when executing. A comment starts with // and includes all the subsequent text on that line.