All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Ask a Question
Search
Search
Sign In
Register
study help
computer science
starting out with programming logic and design
Questions and Answers of
Starting Out With Programming Logic And Design
A program uses two parallel arrays named customer Numbers and balances. The customer Numbers array holds customer numbers and the balances array holds customer account balances. If a particular
What is a subscript?
This is typically the first subscript in an array.a. -1b. 1c. 0d. The size of the array minus one
True or False A declaration for a two-dimensional array requires only one size declarator.
Look at the following pseudocode array declaration:a. How many rows does the array have?b. How many columns does the array have?c. How many elements does the array have?d. Write a pseudocode
Draw a flowchart showing the general logic for finding the highest value in an array.
What is usually the first subscript in an array?
This is typically the last subscript in an array.a. -1b. 99c. 0d. The size of the array minus one
Look at the following pseudocode and answer questions a through d.a. What is the name of the array that is being declared?b. What is the size of the array?c. What data type are the array elements?d.
Draw a flowchart showing the general logic for finding the lowest value in an array.
Assume the following declarations appear in a pseudocode program:Also, assume that values have been stored in each element of first Array. Design an algorithm that copies the contents of first Array
This algorithm uses a loop to step through each element of an array, starting with the first element, searching for a value.a. Sequential searchb. Step-by-step searchc. Elemental searchd. Binary
What does “array bounds checking” mean?
Many programming languages perform this, which means they do not allow a program to use an invalid array subscript.a. Memory checkingb. Bounds checkingc. Type compatibility checkingd. Syntax checking
Design an algorithm for a function that accepts an Integer array as an argument and returns the total of the values in the array.
What is an off-by-one error?
Write a pseudocode algorithm that uses the For Each loop to display all of the values in the following array: Constant Integer SIZE = 10 Declare Integer values [SIZE] = = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
This term describes two or more arrays that hold related data, and the related elements in each array are accessed with a common subscript.a. Synchronous arraysb. Asynchronous arraysc. Parallel
What is a search algorithm?
You typically think of a two-dimensional array as containinga. Lines and statementsb. Chapters and pagesc. Rows and columnsd. Horizontal and vertical elements
Which array element does the sequential search algorithm first look at?
What does the loop do in the sequential search algorithm? What happens when the value being searched for is found?
How do you look for a partial string match when searching an array of strings for a value?
Briefly describe how you get the average of the values in an array.
Briefly describe how you calculate the total of the values in an array.
How many elements does the sequential search algorithm look at in the case that the search value is not found in the array?
Describe the algorithm for finding the highest value in an array.
Describe the algorithm for finding the lowest value in an array.
How do you copy the contents of one array to another array?
How many rows and how many columns are in the following array? Declare Integer points [88] [100]
How do you establish a relationship between the data stored in two parallel arrays?
A program uses two parallel arrays: names and credit Score. The names array holds customer names and the credit Score array holds customer credit scores. If a particular customer’s name is stored
Write a pseudocode declaration for a two-dimensional array initialized with the following table of data: 12 24 32 21 42
Write a pseudocode statement that assigns the value 100 to the very last element in the points array declared in Checkpoint 8.22.Checkpoint 8.22How many rows and how many columns are in the following
A bookstore keeps books on 50 racks with 10 shelves each. Each shelf holds 25 books. Declare a 3D String array to hold the names of all the books in the store. The array’s three dimensions should
Assume the following main module is in a program that includes the binary Search function that was shown in this chapter. Why doesn’t the pseudocode in the main module work? // This program uses
True or False If data is sorted in ascending order, it means it is ordered from lowest value to highest value.
Design a swap module that accepts two arguments of the Real data type and swaps them.
What algorithm does the following pseudocode perform? Declare Integer maxElement Declare Integer index For maxElement = For index arraySize - 1 To 0 Step 1 0 To maxElement - 1 = End For If
Which of the sorting algorithms discussed makes several passes through an array and causes thelarger values to move gradually toward the end of the array with each pass?
True or False If data is sorted in descending order, it means it is ordered from lowest value to highest value.
This type of algorithm rearranges the values stored in an array in some particular order.a. Search algorithmb. Sorting algorithmc. Ordering algorithmd. Selection algorithm
In an average case involving an array of n elements, how many times will a sequential search function have to read the array to locate a specific value?
True or False Regardless of the programming language being used, it is not possible to use the bubble sort algorithm to sort strings.
One of the sorting algorithms discussed works like this: It begins by sorting the first two elements of the array, which becomes a sorted subset. Then the third element is moved to its correct
If an array is sorted in this order, the values are stored from lowest to highest.a. Asymptoticb. Logarithmicc. Ascendingd. Descending
What algorithm does the following pseudocode perform? Declare Integer index Declare Integer scan Declare Integer unsortedValue For index = 1 To arraySize - 1 Set unsortedValue = array[index] Set scan
A binary search function is searching for a value that happens to be stored in the middle element of an array. How many times will the function read an element in the array before finding the value?
One of the sorting algorithms discussed works like this: The smallest value in the array is located and moved to element 0. Then the next smallest value is located and moved to element 1. This
If an array is sorted in this order, the values are stored from highest to lowest.a. Asymptoticb. Logarithmicc. Ascendingd. Descending
Design an algorithm that does the following: opens the number_list.dat file that was created by the algorithm created in question 3, reads all of the numbers from the file and displays them, and then
What is the purpose of the eof function that was discussed in this chapter?
A file exists on the disk named students.dat. The file contains several records, and each record contains two fields: (1) the student’s name, and (2) the student’s score for the final exam.
What algorithm does the following pseudocode perform? Declare Integer startScan Declare Integer minIndex Declare Integer minValue Declare Integer index For startScan = 0 To arraysize 2 Set minIndex =
True or False The average number of comparisons performed by the sequential search algorithm on an array of n elements is n/2 (assuming the search values are consistently found).
What is the maximum number of comparisons that a binary search function will make when searching for a value in a 1,000-element array?
This algorithm makes several passes through an array and causes the larger values to gradually move toward the end of the array with each pass.a. Bubble sortb. Selection sortc. Insertion sortd.
True or False The maximum number of comparisons performed by the sequential search algorithm on an array of n elements is n/2 (assuming the search values are consistently found).
Why is the bubble sort inefficient for large arrays?
On average, with an array of 1,000 elements, how many comparisons will a sequential search perform? (Assume the items being searched for are consistently found in the array.)
In this algorithm, the smallest value in the array is located and moved to element 0. Then the next smallest value is located and moved to element 1. This process continues until all of the elements
Why is the selection sort more efficient than the bubble sort on large arrays?
With an array of 1,000 elements, what is the maximum number of comparisons a binary search will perform?
This algorithm begins by sorting the first two elements of the array, which become a sorted subset. Then, the third element is moved to its correct position relative to the first two elements. At
List the steps that the selection sort algorithm would make in sorting the following values: 4, 1, 3, 2.
This search algorithm steps sequentially through an array, comparing each item with the search value.a. Sequential searchb. Binary searchc. Natural order searchd. Selection search
This search algorithm repeatedly divides the portion of an array being searched in half.a. Sequential searchb. Binary searchc. Natural order searchd. Selection search
List the steps that the insertion sort algorithm would make in sorting the following values: 4, 1, 3, 2.
This search algorithm is adequate for small arrays but not large arrays.a. Sequential searchb. Binary searchc. Natural order searchd. Selection search
This search algorithm requires that the array’s contents be sorted.a. Sequential searchb. Binary searchc. Natural order searchd. Selection search
Why doesn’t the following pseudocode module work as indicated in the comments? // The readFile method accepts a string containing a filename as // an argument. It reads and displays all the items
Where are files normally stored?
Design a program that opens an output file with the external name my_name.dat, writes your name to the file, and then closes the file.
True or False In most languages, when you open an output file and that file already exists on the disk, the contents of the existing file will be erased.
Design a program that opens the my_name.dat file that was created by the algorithm in question 1, reads your name from the file, displays the name on the screen, and then closes the file.
Design an algorithm that does the following: opens an output file with the external name number_list.dat, uses a loop to write the numbers 1 through 100 to the file, and then closes the file.
When a program is finished using a file, it should do this.a. Erase the fileb. Open the filec. Close the filed. Encrypt the file
True or False The purpose of an EOF marker is to indicate where a field ends. Files typically contain several EOF markers.
If an existing file is opened in append mode, what happens to the file’s existing contents?
Modify the algorithm that you designed in question 4 so it adds all of the numbers read from the file and displays their total.
Write pseudocode that opens an output file with the external name number_list.dat, but does not erase the file’s contents if it already exists.
True or False In control break logic, the program performs some ongoing task (such as processing the items in a file), but permanently stops the task when a control variable reaches a specific value
What is control break logic?
A file exists on the disk named students.dat. The file contains several records, and each record contains two fields: (1) the student’s name, and (2) the student’s score for the final exam.
In most programming languages, if a file already exists what happens to it if you try to open it as an output file?
This is a character or set of characters that marks the end of a piece of data.a. Median valueb. Delimiterc. Boundary markerd. EOF marker
Generally speaking, what is a delimiter? How are delimiters typically used in files?
In many systems, what is written at the end of a file?
This is a character or set of characters that marks the end of a file.a. Median valueb. Delimiterc. Boundary markerd. EOF marker
The expression NOT eof(myFile) is equivalent toa. eof(myFile) == Trueb. eof(myFile)c. eof(myFile) == Falsed. eof(myFile) < 0
Design an algorithm that uses a For loop to write the numbers 1 through 10 to a file.
What is the purpose of the eof function?
Is it acceptable for a program to attempt to read beyond the end of a file?
Which of the following loops would you use to read all of the items from the file associated with my File? a. While eof (myFile) Read myFile item End While b. While NOT eof (myFile) Read myFile
What would it mean if the expression eof(myFile) were to return True?
What is a menu-driven program?
A menu is a ________.a. Case structure that selects an operation in a programb. Group of modules that perform individual tasksc. List of operations displayed on the screen that the user may choose
You cannot use nested If-Then-Else statements to perform the action selected by the user from a menu.
Design an algorithm that displays the following menu, gets the user’s selection, and validates the selection. Main Menu 1. Open a new document. 2. Close the current document. 3. Print the current
The items displayed in a menu are often preceded by a number, letter, or other character. What is the purpose of this character?
Showing 300 - 400
of 584
1
2
3
4
5
6