Python Quiz 1 added!

, ,

this is a test quiz to see how this layout looks, using the HD Quiz plugin.

photo of a red snake
Photo by Jan Kopřiva on Pexels.com

Results

-
congrats!

review what you’ve missed and try again!

Share your score!
Tweet your score!
Share to other

#1. Assembly language is considered a high-level language.

Although assembly language makes it unnecessary to write binary machine language instructions, it is not without difficulties. Assembly language is primarily a direct substitute for machine language, and like machine language, it requires that you know a lot about the CPU. Assembly language also requires that you write a large number of instructions for even
the simplest program.

Because assembly language is so close in nature to machine language, it is referred to as a low-level language.

In the 1950s, a new generation of programming languages known as high-level languages began to appear. A high-level language allows you to create powerful and complex pro-grams without knowing how the CPU works and without writing large numbers of low-level
instructions. In addition, most high-level languages use words that are easy to understand.

#2. Negative numbers are encoded using the __________ technique.

The binary numbering system can be used to repre-sent only integer numbers, beginning with 0. Negative numbers and real numbers (such as 3.14159) cannot be represented using the simple binary numbering technique we discussed.
Computers are able to store negative numbers and real numbers in memory, but to do so they use encoding schemes along with the binary numbering system.

Negative numbers are encoded using a technique known as two’s complement, and real numbers are encoded in
floating-point notation. You don’t need to know how these encoding schemes work, only that they are used to convert negative numbers and real numbers to binary format.

#3. The __________ translates an assembly language program to a machine language program.

Assembly language programs cannot be executed by the CPU, however. The CPU only understands machine language, so a special program known as an assembler is used to translate an assembly language program to a machine language program.

#4. The tiny dots of color that digital images are composed of are called __________.

#5. Any piece of data that is stored in a computer’s memory must be stored as a binary number.

#6. The physical devices that a computer is made of are referred to as __________.

Hardware is all the physical devices, or components, of which a computer is made.

#7. Today, CPUs are small chips known as __________.

Today, CPUs are small chips known as microprocessors. In addition to being much smaller than the old electromechanical CPUs in early computers, microprocessors are also much more powerful.

The historic – not modern – ENIAC is considered by many to be the world’s first programmable electronic computer. It was built in 1945 to calculate artillery ballistic tables for the U.S. Army. This machine, which was primarily one big CPU, was 8 feet tall, 100 feet long, and weighed 30 tons.

#8. This is a volatile type of memory that is used only for temporary storage while a program is running.

You can think of main memory as the computer’s work area. This is where the computer
stores a program while the program is running, as well as the data that the program is
working with. For example, suppose you are using a word processing program to write an
essay for one of your classes. While you do this, both the word processing program and the
essay are stored in main memory.
Main memory is commonly known as random-access memory, or RAM. It is called this
because the CPU is able to quickly access data stored at any random location in RAM.
RAM is usually a volatile type of memory that is used only for temporary storage while
a program is running. When the computer is turned off, the contents of RAM are erased.

#9. Computers can only execute programs that are written in __________.

From Machine Language to Assembly Language
Computers can only execute programs that are written in machine language. A program can have thousands or even millions of binary instructions, and writ-ing such a program would be very tedious and time consuming. Programming in machine
language would also be very difficult, because putting a 0 or a 1 in the wrong place will cause an error.

Although a computer’s CPU only understands machine language, it is impractical for people to write programs in machine language. For this reason, assembly language was created in the early days of computing as an alternative to machine language. Instead of using binary numbers for instructions, assembly language uses short words that are known as mnemonics. For example, in assembly language, the mnemonic add typically means to add numbers, mul typically means to multiply numbers, and mov typically means to move a value to a location in memory. When a programmer uses assembly language to write a program, he or she can write short mnemonics instead of binary numbers.

#10. A bit that is turned off represents the following value: __________.

In most computer systems, bits are tiny electrical components that can hold either a positive or a negative charge. Computer scientists think of a positive charge as a switch in the on position, and a negative charge as a switch in the off position.

A bit can be used in a very limited way to represent numbers. Depending on whether the bit is turned on or off, it can represent one of two different values. In computer systems, a bit that is turned off represents the number 0, and a bit that is turned on represents the number 1. This corresponds perfectly to the binary numbering system. In the binary numbering system (or binary, as it is usually called), all numeric values are written as sequences of 0s
and 1s.

When all of the bits in a byte are set to 0 (turned off), then the value of the byte is 0. When all of the bits in a byte are set to 1 (turned on), then the byte holds the largest value that can be stored in it. The largest value that can be stored in a byte is 1 2 4 8 16  32 64 128 = 255. This limit exists because there are only eight bits in a byte.

#11. The part of a computer that runs programs is called __________.

The CPU is the most important component in a computer because it is the part of the computer that runs programs.

#12. Today, CPUs are huge devices made of electrical and mechanical components such as vacuum tubes and switches.

#13. An interpreter is a program that both translates and executes the instructions in a high-level language program.

The Python language uses an interpreter, which is a program that both translates and
executes the instructions in a high-level language program. As the interpreter reads
each individual instruction in the program, it converts it to machine language instruc-tions then immediately executes them. This process repeats for every instruction in
the program. This process is illustrated in Figure 1-19. Because interpreters combine
translation and execution, they typically do not create separate machine language
programs.

#14. If you were to look at a machine language program, you would see __________.

#15. Word processing programs, spreadsheet programs, email programs, web browsers, and games are all examples of utility programs.

A utility program performs a specialized task that enhances the computer’s operation or safeguards data. Examples of utility programs are virus scanners,
file compression programs, and data backup programs.

Programs that make a computer useful for everyday tasks are known as application software. These are the programs that people normally spend most of their time running on their computers. Two commonly used applications are Microsoft Word, a word processing program, and PowerPoint, a presentation program. Some other examples of application software are spreadsheet programs, email programs, web browsers, and game programs.

#16. A component that collects data from people or other devices and sends it to the computer is called __________.

Input Devices
Input is any data the computer collects from people and from other devices. The component that collects the data and sends it to the computer is called an input device. Common input devices are the keyboard, mouse, touchscreen, scanner, microphone, and digital camera. Disk drives and optical drives can also be considered input devices, because programs and data are retrieved from them and loaded into the computer’s memory.

Output Devices
Output is any data the computer produces for people or for other devices. It might be a sales report, a list of names, or a graphic image. The data is sent to an output device, which formats and presents it. Common output devices are video displays and printers. Disk drives can also be considered output devices because the system sends data to them in order to be saved.

#17. A __________ is enough memory to store a letter of the alphabet or a small number.

#18. In the __________ numbering system, all numeric values are written as sequences of 0s and 1s.

#19. A major drawback of Python is that Python code is more difficult to read than code in most other programming languages.

False; Designed with readability in mind: “Simple is better than complex”

#20. A type of memory that can hold data for long periods of time, even when there is no power to the computer, is called __________.

Secondary storage is a type of memory that can hold data for long periods of time, even
when there is no power to the computer. Programs are normally stored in secondary mem-ory and loaded into main memory as needed. Important data, such as word processing
documents, payroll data, and inventory records, is saved to secondary storage as well.

#21. A video display is a(n) __________ device.

Input Devices
Input is any data the computer collects from people and from other devices. The component that collects the data and sends it to the computer is called an input device. Common input devices are the keyboard, mouse, touchscreen, scanner, microphone, and digital camera. Disk drives and optical drives can also be considered input devices, because programs and data are retrieved from them and loaded into the computer’s memory.

Output Devices
Output is any data the computer produces for people or for other devices. It might be a sales report, a list of names, or a graphic image. The data is sent to an output device, which formats and presents it. Common output devices are video displays and printers. Disk drives can also be considered output devices because the system sends data to them in order to be saved.

#22. Machine language is the only language that a CPU understands.

A computer’s CPU can only understand instructions that are written in
machine language. Because people find it very difficult to write entire
programs in machine language, other programming languages have been
invented.

#23. A(n) __________ program translates a high-level language program into a separate machine language program.

A compiler is a program that translates a high-level language program into a separate machine language program. The machine language program can then be executed any time it is needed.

#24. The words that make up a high-level programming language are called __________.

#25. Real numbers are encoded using the __________ technique.

The binary numbering system can be used to repre-sent only integer numbers, beginning with 0. Negative numbers and real numbers (such as 3.14159) cannot be represented using the simple binary numbering technique we discussed.
Computers are able to store negative numbers and real numbers in memory, but to do so they use encoding schemes along with the binary numbering system.

Negative numbers are encoded using a technique known as two’s complement, and real numbers are encoded in
floating-point notation. You don’t need to know how these encoding schemes work, only that they are used to convert negative numbers and real numbers to binary format.

Finish

1 comment

Leave a Reply to random_student Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.