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
Design a program with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number to signal the end of the series. After all the positive numbers have
Design a program that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day, and continues to double
Design a program that asks the user for a series of names (in no particular order). After the final person’s name has been entered, the program should display the name that is first alphabetically
Design a program that uses nested loops to display a multiplication table for the numbers 1 through 12. The program’s output should look like this:and so forth.. = 10 = 0 1 * 1 = 1 1 * 2 = 2 13 = 3
Write a pseudocode statement that assigns the sum of 10 and 14 to the variable total.
Write a pseudocode statement that subtracts the variable downPayment from the variable total and assigns the result to the variable due.
Write a pseudocode statement that multiplies the variable subtotal by 0.15 and assigns the result to the variable totalFee.
Write a pseudocode statement that assigns the value 27 to the variable count.
Design an algorithm that prompts the user to enter his or her height and stores the user’s input in a variable named height.
Design an algorithm that prompts the user to enter his or her favorite color and stores the user’s input in a variable named color.
Assume the variables result, x, y, and z are all integers, and that x = 4, y = 8, and z = 2. What value will be stored in result in each of the following statements?a. Set result = x + yb. Set result
Write a pseudocode statement that declares the variable cost so it can hold real numbers.
Write a pseudocode statement that declares the variable total so it can hold integers. Initialize the variable with the value 0.
If the following pseudocode were an actual program, what would it display? Declare Integer Declare Integer Declare Integer Declare Integer result a = 5 = 2 b c = 3 Set result = a + b Display result C
If the following pseudocode were an actual program, what would it display? Declare Integer num Set num= 5 Display num 99
If the following pseudocode were an actual program, why would it not display the output that the programmer expects? Declare String favorite Food Display "What is the name of your favorite
If the programmer translates the following pseudocode to an actual programming language, a syntax error is likely to occur. Can you find the error? Declare String 1st Prize Display "Enter the award
The following code will not display the results expected by the programmer. Can you find the error? Declare Real lowest, highest, average Display "Enter the lowest score." Input lowest Display "Enter
Find the error in the following pseudocode. Display "Enter the length of the room. Input length Declare Integer length
Find the error in the following pseudocode. Declare Integer valuel, value2, value3, sum Set sum = valuel+ value2 + value3
Find the error in the following pseudocode. Declare Real pi Set 3.14159265 = pi Display "The value of pi is ", pi
What is a module?
How do modules help you to reuse code in a program?
Find the error in the following pseudocode. Module main () Declare Real mileage Call getMileage () Display "You've driven a total of ", mileage, "miles." End Module
Design a module named times Ten. The module should accept an Integer argument. When the module is called, it should display the product of its argument multiplied times 10.
Examine the following pseudocode module header, and then write a statement that calls the module, passing 12 as an argument. Module showValue (Integer quantity)
Name and describe the two parts that a module definition has in most languages.
Find the error in the following pseudocode. Module main () Call getCalories () End Module
A benefit of using modules that helps to reduce the duplication of code within a program is _______.a. Code reuseb. Divide and conquerc. Debuggingd. Facilitation of teamwork
True or False Modules make it easier for programmers to work in teams.
True or False Module names should be as short as possible.
Look at the following pseudocode module header:Now look at the following call to myModule:When this call executes, what value will be stored in a? What value will be stored in b? What value will be
When a module is executing, what happens when the end of the module is reached?
How do modules help you reuse code in a program?
Find the potential error in the following pseudocode. Module main () Call squareNumber (5) End Module
The first line of a module definition is known as the ______.a. Bodyb. Introductionc. Initializationd. Header
Assume that a pseudocode program contains the following module:Assume that the same program has a main module with the following variable declarations:Write a statement that calls the display module
True or False Calling a module and defining a module mean the same thing.
Find the error in the following pseudocode. Module main ()
How can modules make the development of multiple programs faster?
You_______ the module to execute it.a. Defineb. Callc. Importd. Export
How can modules make it easier for programs to be developed by teams of programmers?
True or False A flowchart shows the hierarchical relationships between modules in a program.
In most languages, where does a local variable’s scope begin and end?
Design a module named getNumber, which uses a reference parameter variable to accept an Integer argument. The module should prompt the user to enter a number and then store the input in the reference
A_________ point is the memory address of the location in the program that the computer will return to when a module ends.a. Terminationb. Module definitionc. Returnd. Reference
What will the following pseudocode program display? Module main () Declare Integer x = 1 Declare Real y = 3.4 Display x, " ", y Call changeUs (x, y) Display x, " ", y End Module
True or False A hierarchy chart does not show the steps that are taken inside a module.
What is the difference between passing an argument by value and passing it by reference?
In most languages, a module definition has what two parts?
What will the following pseudocode program display? Module main () Declare Declare Integer x = 1 Real y = 3.4 Display x, " ", y Call changeUs (x, y) Display x, " ", y End Module
True or False A statement in one module can access a local variable in another module.
What does the phrase “calling a module” mean?
A_______ is a diagram that gives a visual representation of the relationships between modules in a program.a. Flowchartb. Module relationship chartc. Symbol chartd. Hierarchy chart
True or False In most programming languages, you cannot have two variables with the same name in the same scope.
When a module is executing, what happens when the end of the module is reached?
A _____ is a variable that is declared inside a module.a. Global variableb. Local variablec. Hidden variabled. None of the above; you cannot declare a variable inside a module
True or False Programming languages typically require that arguments be of the same data type as the parameters that they are passed to.
Describe the steps involved in the top-down design process.
True or False Most languages do not allow you to write modules that accept multiple arguments.
A(n)______ is a piece of data that is sent into a module.a. Argumentb. Parameterc. Headerd. Packet
True or False When an argument is passed by reference, the module can modify the argument in the calling part of the program.
A(n)_______ is a special variable that receives a piece of data when a module is called.a. Argumentb. Parameterc. Headerd. Packet
True or False Passing an argument by value is a means of establishing two-way communication between modules.
Is it usually permissible to have more than one variable with the same name in the samescope? Why or why not?
When ________, only a copy of the argument’s value is passed into the parameter variable.a. Passing an argument by referenceb. Passing an argument by namec. Passing an argument by valued. Passing
Part of the following pseudocode is incompatible with the Java, Python, C, and C++ languages. Identify the problem. How would you fix the problem if you were to translate this pseudocode into one of
Design an If-Then statement (or a flowchart with a single alternative decision structure) that assigns 20 to the variable y and assigns 40 to the variable z if the variable x is greater than 100.
If you need to test the value of a variable and use that value to determine which statement or set of statements to execute, which structure would be the most straightforward to use?
What is a count-controlled loop?
Is it usually permissible for a local variable in one module to have the same name as a local variable in a different module?
When ________, the module can modify the argument in the calling part of the program.a. Passing an argument by referenceb. Passing an argument by namec. Passing an argument by valued. Passing an
What are the pieces of data that are passed into a module called?
A variable that is visible to every module in the program is a _________.a. Local variableb. Universal variablec. Program-wide variabled. Global variable
What are the variables that receive pieces of data in a module called?
Does it usually matter whether an argument’s data type is different from the data type of the parameter that it is being passed to?
Explain what is meant by the term conditionally executed.
You need to test a condition and then execute one set of statements if the condition is true. If the condition is false, you need to execute a different set of statements. What structure will you use?
The intended purpose of the following module is to set the temp parameter to the value 32.0 if it is not already equal to 32.0. This will not work as the programmer expects, however. Find the
Design an If-Then statement (or a flowchart with a single alternative decision structure) that assigns 0 to the variable b and assigns 1 to the variable c if the variable a is less than 10.
The intended purpose of the following module is to determine whether the value parameter is within a specified range. The module will not work, however. Find the problem. Module checkRange (Integer
The following pseudocode contains several nested If-Then-Else statements. Unfortunately, it was written without proper alignment and indentation. Rewrite the code and use the proper conventions of
Design an If-Then-Else statement (or a flowchart with a dual alternative decision structure) that assigns 0 to the variable b if the variable a is less than 10. Otherwise, it should assign 99 to the
Briefly describe how the AND operator works.
The symbols >,
Briefly describe how the OR operator works.
Design nested decision structures that perform the following: If amount1 is greater than 10 and amount2 is less than 100, display the greater of amount1 and amount2.
Write a pseudocode If-Then statement that assigns 0 to x if y is equal to 20.
Rewrite the following If-Then-Else If statement as a Select Case statement. If selection == 1 Then Display "You selected A." Else If selection == 2 Then Display "You selected 2." Else If selection ==
When determining whether a number is inside a range, which logical operator is it best to use?
You use a(n) statement in pseudocode to write a single alternative decision structure.a. Test-Jumpb. If-Thenc. If-Then-Elsed. If-Call
Design an If-Then-Else statement (or a flowchart with a dual alternative decision structure) that displays “Speed is normal” if the speed variable is within the range of 24 to 56. If speed holds
You use a(n) statement in pseudocode to write a dual alternative decision structure.a. Test-Jumpb. If-Thenc. If-Then-Elsed. If-Call
Design an If-Then-Else statement (or a flowchart with a dual alternative decision structure) that determines whether the points variable is outside the range of 9 to 51. If the variable holds a value
A structure allows you to test the value of a variable or an expression and then use that value to determine which statement or set of statements to execute.a. Variable test decisionb. Single
What statement do you use in pseudocode to write a dual alternative decision structure?
A(n) section of a Select Case statement is branched to if none of the case values match the expression listed after the Select statement.a. Elseb. Defaultc. Cased. Otherwise
Design a case structure that tests the month variable and does the following:If the month variable is set to 1, it displays “January has 31 days.”If the month variable is set to 2, it displays
If the following pseudocode were an actual program, what would it display? If "z" < "a" Then Display "z is less than a." Else Display End If "z is not less than a."
When you write an If-Then-Else statement, under what circumstances do the statements that appear between Else and End If execute?
Showing 100 - 200
of 584
1
2
3
4
5
6