Module 1.1-1.4

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

Which of the following best describes how a compiled program is run by a computer?

The binary instructions from the program are loaded into RAM. The CPU reads and executes instructions, storing and accessing data from RAM as needed.

Which of the following is the MOST important reason computers use artificial languages over natural language?

The syntax of artificial languages is explicit and unambiguous

Which of the following best describes "compilation" in reference to computer science?

Code in a high-level language is converted to low-level instructions which can be interpreted and run by the CPU.

A program that Thomas has written is complete. It has been tested thoroughly, and some outputs were not as expected. Thomas is now going through the code carefully attempting to establish the cause of these errors and change the code to remove them. What is this procedure called?

Debugging

Jeremiah is part of a group planning a summer fair at which local businesses can run stalls and events. He wants to use his programming skills to develop an app for the fair which businesses will be able to use to communicate information about their activities at the fair with visitors. Which of the following would be the best first step for Jeremiah to take?

Find out from the businesses and potential visitors what information and format they think should be used for the app

Which of the following should be true of any algorithm? I. The order in which the steps making up the algorithm are followed is logically determined II. Following the instructions in the algorithm will always result in the same outputs, regardless of any inputs III. The instructions in the algorithm contain all necessary information to be implemented

I and III only

Understanding of the life cycle of a program is an essential component to becoming an effective programmer. Which of the following is the best example of how the life cycle of a program should work?

Idea→algorithm→write code→execute code→debug→maintain

The algorithm below simulates rolling a regular 6-sided die twice. Consider the goal of determining if the sum of the values of the two rolls is odd or even.

If the value found in step 6 is 10, 20, 30, 40, 50 or 60 then the sum is even If the last digit of the value found in step 6 is 5, then the sum is odd

onsider the following two implementations of the same algorithm, each written in a different language. Language A: Calculate the average daily rainfall for the week (averageRainfall) by adding together the rainfall totals for each of the 7 days of the week (sun, mon, tue, wed, thu, fri, and sat) and dividing the sum by 7. Language B: Take the total amount of rain from each day of the week (sunday, monday, tuesday, wednesday, thursday, friday and saturday) and then average them together to get the average daily rainfall for the week (averageRainfall). Which of the following statements about these two implementations is true?

Language B is ambiguous because the process of "average" is not explained well

Which of the following describes the part of a computer which stores instructions and information which has been input to the computer?

RAM

A statistics teacher wishes to create a program on her calculator that generates a random even integer. The command built in the calculator to generate a random positive integer is RANDOM(a,b). This command generates a random integer between integers a and b (and including a and b). Which of the following lines of code will ensure that the random integer generated will be even?

RANDOM(a,b) * 2

Which of the following best describes high-level computing languages?

They are not very ambiguous


Ensembles d'études connexes

Unit 3: Introduction to Contracts

View Set

2nd year, Lever1 Lesson11 Comparing Direct Current to Alternating Current

View Set