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
Write an If-Then statement that sets the variable hours to 10 when the flag variable minimum is set.
Convert the following pseudocode to an If-Then-Else If statement: If number == 1 Then Display "One" Else If number Display "Two" Else 2 Then If number 3 Then
What statement do you use in pseudocode to write a dual alternative decision structure?
When you write an If-Then-Else statement, under what circumstances do the statements that appear between the Else clause and the End If clause execute?
What is a multiple alternative decision structure?
How do you write a multiple alternative decision structure in pseudocode?
What does the case structure test, in order to determine which set of statements to execute?
You need to write a multiple alternative decision structure, but the language you are using will not allow you to perform the test you need in a Select Case statement. What can you do to achieve the
Find the error in the following pseudocode. Declare Boolean finished = = False Declare Integer value, cube While NOT finished Display "Enter a value to be cubed." Input value; Set cube =
What values can you store in a Boolean variable?
The programmer intended the following pseudocode to display the numbers 1 through 60, and then display the message “Time’s up!” It will not function as intended, however. Find the error.
The programmer intended the following pseudocode to get five sets of two numbers each, calculate the sum of each set, and calculate the sum of all the numbers entered. It will not function as
What is a condition-controlled loop?
What is a condition-controlled loop?
True or False You should not write code that modifies the contents of the counter variable in the body of a For loop.
What is a count-controlled loop?
True or False You cannot display the contents of the counter variable in the body of a loop.
What three actions do count-controlled loops typically perform using the counter variable?
What is the difference between a pretest loop and a posttest loop?
The Do-While loop is a____ type of loop.a. Pretestb. Posttestc. Prequalifiedd. Post iterative
The For loop is a_______ type of loop.a. Pretestb. Posttestc. Prequalifiedd. Post iterative
True or False It is not possible to increment a counter variable by any value other than 1.
True or False The following statement decrements the variable x: Set x = x - 1.
A For loop looks like what other loop in a flowchart?
A_____ loop always executes at least once.a. Pretestb. Posttestc. Condition-controlledd. Count-controlled
What is the difference between a Do-While loop and a Do-Until loop?
What is a counter variable?
What three actions do count-controlled loops typically perform using the counter variable?
Look at the following pseudocode. If it were a real program, what would it display? Declare Integer number Set number = number + 1 Display number = 5
When you increment a variable, what are you doing? When you decrement a variable, what are you doing?
Look at the following pseudocode. If it were a real program, what would it display? Declare Integer counter For counter = 1 To 5 Display counter End For
Look at the following pseudocode. If it were a real program, what would it display? Declare Integer counter For counter = 0 To 500 Step 100 Display counter End For
Look at the following pseudocode. If it were a real program, what would it display? Declare Integer counter = 1 Constant Integer MAX 8 While counter
Look at the following pseudocode. If it were a real program, what would it display? Declare Integer counter Constant Integer MAX = 7 While counter
Look at the following pseudocode. If it were a real program, what would it display? Declare Integer counter Constant Integer MIN = 1 For counter = 5 To MIN Step -1 Display counter End For
Look at the following pseudocode. If it were a real program, what would it display? Declare Integer numberl Set number1= numberl + number2 = 10, number2 = 5 Display numberl Display number2
A program that calculates the total of a series of numbers typically has what two elements?
Look at the following pseudocode. If it were a real program, what would it display? Declare Integer counter, total For counter = 1 To 5 Set total End For Display total = total + counter =
How does a function differ from a module?
True or False The code for a library function must appear in a program in order for the program to call the library function.
What is the difference between a module and a function?
The programmer intends for this pseudocode to display three random numbers in the range of 1 through 7. According to the way we’ve been generating random numbers in this book, however, there
As shown in this chapter, write a pseudocode statement that generates a random number in the range of 1 through 100 and assigns it to a variable named rand.
This term describes any mechanism that accepts input, performs some operation that cannot be seen on the input, and produces output.a. Glass boxb. White boxc. Opaque boxd. Black box
What three characteristics of a function are described in an IPO chart?
Can you find the reason that the following pseudocode function does not return the value indicated in the comments? // The calcDiscount Price function accepts an item's price and // the discount
The following pseudocode statement calls a function named half, which returns a value that is half that of the argument. (Assume both the result and number variables are Real.) Write pseudocode for
Assume names is an Integer array with 20 elements. Design a For loop that displays each element of the array.
This part of a function definition specifies the data type of the value that the function returns.a. Headerb. Footerc. Bodyd. Return statement
True or False In many languages it is an error to assign a real number to an integer variable.
When a conversion function is used to convert a real number to an integer, what usually happens to the real number’s fractional part?
A pseudocode program contains the following function definition:Write a statement that passes the value 4 to this function and assigns its return value to the variable result. Function Integer cube
Can you find the reason that the following pseudocode does not perform as indicated in the comments? // Find the error in the following pseudocode. Module main () Declare Real value, result // Get a
In pseudocode, what does the following statement do? Set x = random (1, 100)
This part of a function definition is comprised of one or more statements that are executed when the function is called.a. Headerb. Footerc. Bodyd. Return statement
True or False In some languages you must use a library function to raise a number to a power.
What is a substring?
In pseudocode, what does the following statement do? Display random (1, 20)
Design a pseudocode function named timesTen that accepts an Integer argument. When the function is called, it should return the value of its argument multiplied times 10.
In pseudocode, this statement causes a function to end and sends a value back to the part of the program that called the function.a. Endb. Sendc. Exitd. Return
True or False In a case-sensitive comparison, the strings "yoda" and "YODA" are equivalent.
What is the purpose of the stringToInteger and stringToReal functions described in this chapter?
Design a pseudocode function named getFirstName that asks the user to enter his or her first name, and returns it.
What is the purpose of the isInteger and isReal functions described in this chapter?
Look at the following pseudocode function definition:a. What is the name of the function?b. What type of data does the function return?c. Given the function definition, what will the following
Assume that a program has two String variables named str1 and str2. Write a pseudocode statement that assigns an all uppercase version of str1 to the str2 variable.
This is an example of a data type conversion function in pseudocode.a. Sqrtb. ToRealc. Substringd. IsNumeric
This type of error occurs when you try to assign a value of one data type to a variable of anotherdata type.a. Type mismatch errorb. Boolean logic errorc. Relational errord. Bit conversion error
Why does the following pseudocode not perform as indicated in the comments? // This program asks the user to enter a value // between 1 and 10 and validates the input. Declare Integer value // Get a
This is a string inside of another string.a. Substringb. Inner stringc. Mini stringd. Component string
Design an algorithm that prompts the user to enter a positive nonzero number and validates the input.
Why does the following pseudocode not perform as indicated in the comments? // This program gets a dollar amount from the user // and validates the input. Declare Real amount // Get the amount from
True or False The priming read appears inside the validation loop.
Design an algorithm that prompts the user to enter a number in the range of 1 through 100 and validates the input.
True or False The approach of using a posttest validation loop shown in this chapter requires a priming read.
The following pseudocode works, but it performs a case-sensitive validation of the user’s input. How could the algorithm be improved so the user does not have to pay attention to capitalization
What is the purpose of the priming read?
Design an algorithm that prompts the user to enter “yes” or “no” and validates the input. (Use a case-insensitive comparison.)
In this chapter you saw how a posttest loop can be used in input validation, as an alternative to the priming read followed by a pretest loop. Why is it typically not best to use a posttest loop
The term empty input describes what happens whena. The user presses the and then the keyb. An input operation attempts to read data, but there is no data to readc. The user enters 0 when 0 is an
Design an algorithm that prompts the user to enter a number that is greater than 99 and validates the input.
Design an algorithm that prompts the user to enter a secret word. The secret word should be at least 8 characters long. Validate the input.
Can you store a mixture of data types in an array?
This appears in an array declaration and specifies the number of elements in the array.a. Subscriptb. Size declaratorc. Array named. Initialization value
What is the error in the following pseudocode? // This program uses an array to display five names. Constant Integer SIZE = 5 Declare String names [SIZE] Declare Integer index For index = 0 TO
True or False You can store a mixture of different data types in an array.
Write a pseudocode declaration for a String array initialized with the following strings: "Einstein", "Newton", "Copernicus", and "Kepler".
What is an off-by-one error?
What is the error in the following pseudocode? // This program displays the highest value in the array. Declare Integer SIZE = 3 Declare Integer values [SIZE] 1, 3, 4 Declare Integer index Declare
True or False In most languages, an array’s size cannot be changed while the program is running.
What is an array size declarator?
To make programs easier to maintain, many programmers use these to specify the size of an array.a. Real numbersb. String expressionsc. Math expressionsd. Named constants
In most languages, can the size of an array be changed while the program is running?
This is an individual storage location in an array.a. Elementb. Binc. Cubby holed. Size declarator
Assume the arrays numberArray1 and numberArray2 each have 100 elements. Design an algorithm that copies the values in numberArray1 to numberArray2.
What is the error in the following pseudocode? // The searchName function accepts a string containing the name // to search for, an array of strings containing the names, and // an integer specifying
True or False Array bounds checking typically occurs while a program is running.
What is an array element?
This is a number that identifies a storage location in an array.a. Elementb. Subscriptc. Size declaratord. Identifier
True or False You can do many things with arrays, but you cannot pass one as an argument to a module or a function.
Showing 200 - 300
of 584
1
2
3
4
5
6