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
Hire a Tutor
AI Tutor
New
Search
Search
Sign In
Register
study help
computer science
prelude to programming
Questions and Answers of
Prelude to Programming
If N1 = "Ann" and N2 = "Anne", indicate whether each of the following statements is true or false:a. T F (N1 == N2) AND (N1 >= "Ann")b. T F (N1 == N2) OR (N1 >= "Ann")c. T F NOT (N1 > N2)
Help users calculate their car’s miles per gallon. Write a program to allow a user to enter the number of miles driven and the number of gallons of gas used. The output should be the miles per
Indicate whether each of the following statements is true or false:a. T F "A" != "A "b. T F "E" == "e"
A biologist determines that the approximate number, Number, of bacteria present in a culture after a certain number of days, Time, is given by the following formula:Number = BacteriaPresent *
If Number = 3, indicate whether each of the following statements is true or false:a. T F (Number * Number) >= (2 * Number)b. T F (3 * Number − 2) >= 7
Allow the user to enter a series of temperatures in degrees Celsius (C) terminated by the input of −999. For each one, find the corresponding temperature in degrees Fahrenheit (F). The conversion
Using the Floor() function has the same effect as using the ____________ function.
The number N factorial, denoted by N!, is defined to be the product of the first N positive integers:N! = 1 × 2 × . . . × NFor example:5! = 1 × 2 × 3 × 4 × 5 = 1207! = 1 × 2 × 3 × 4 × 5 ×
To ____________ data means to ensure that they are in the proper range.
Input a list of people’s ages from the user (terminated by 0) and find the average age. Be sure to check that the user enters only positive numbers.
If a For loop’s increment is positive, then the body of the loop will not be executed if the initial value is ____________ the limiting value.
Find the sum of the squares of the integers from 1 to MySquare, where MySquare is input by the user. Be sure to check that the user enters a positive integer.
The counter variable in a For loop will decrease in value on each pass through the loop if the value of the loop’s increment is ____________.
Consider the following statement:Set Number3 = Sqrt(Number1)/Number2If Number1 and Number2 were input by the user and properly validated to ensure that Number1 is greater than or equal to 0 and
Which block of statements, the Then clause or the Else clause, provides the error trap in Exercise 65?Data from Exercise 65 Declare X As Integer Input X If X != 0 Then Write 1/X Else Write "The
What is displayed when the code corresponding to the program segment below is run with the following:(a) X = 4(b) X = 0
What is displayed when the code corresponding to the following program segment is run? Set Y = 1 If Sqrt(Y - 1) == 0 Then Write "YES" Else Write "NO" End If
This program segment is supposed to display NEGATIVE if Number is less than 0, SMALL if Number lies between 0 and 5 (inclusive), and LARGE if Number is greater than 5. Correct the logic error so that
This program segment is supposed to display HELLO if Grade == "A" and display GOODBYE, otherwise. Correct the logic error so that it works correctly. If Grade != "A" Then Write "HELLO" Else Write
What is displayed when the code corresponding to the following program segment is run and the input is as follows:(a) -1(b) 0(c) 1 Set Numberl = 1 Input Number2 Select Case Of Number2 Case -1: Write
Using the code shown below, what will be displayed when the input is as follows:(a) -1(b) 0(c) 1 Input Number If Number < 0 Then Write "1" Else If Number == 0 Then Write "2" Else Write "3" End If End
Suppose that we replace the first statement in Exercise 58 bySet X = −5What would be displayed when the code is run using this value?Data from Exercise 58 Set X = 5 If X > 0 Then Write X End If If
What is displayed when the code corresponding to the following program segment is run? Set X = 5 If X > 0 Then Write X End If If NOT ((X 0) OR (X < 0)) Then =D3D Write "Not" End If If (X A 2 >= 0)
Write pseudocode that uses nested If-Then-Else statements to implement the flowchart in Figure 4.25. Assume that Score is an integer between 1 and 10 inclusive. Enter Input Score Is Is No No Score ==
Write pseudocode that uses a Case statement to achieve the same action as that indicated by the flowchart in Figure 4.25. Assume that Score is an integer between 1 and 10 inclusive. Enter Input Score
Write pseudocode that uses If-Then statements to achieve the same action as that indicated by the flowchart shown in Figure 4.25. Assume that Score is an integer between 1 and 10 inclusively. Enter
Which type of selection structure does the flowchart in Figure 4.25 represent? Enter Input Score Is Is No No Score == Score 7, 8, 9, 10? 5, 6? Yes Yes Write Write Write "Pass" "Retest" "Fail" Exit
Write a program segment that inputs a number X and does all of the following:a. Displays the reciprocal of its square root, 1/Sqrt(X), if X > 0b. Displays "Error: Division by zero", if X = 0c.
Write 3 short program segments that input Num, then display "Yes" if Num == 1, display "No" if Num == 2, and display "Maybe" if Num == 3. Implement this program segment by:(a) A sequence of If-Then
Evaluate the following expression, given that A = 1 and B = 3. Your answer will either be true or false.B^3 % A > B^3 * A
Evaluate the following expression, given that A = 3 and B = 2. Your answer will either be true or false.(A + 6)^2 − (B + 4 * A) <= A^3 + B * 5
Evaluate the following expression, given that X = 3, Y = 5, and Z = 2. Your answer will either be true or false.(NOT (X < Y) OR (Y > Z)) AND (X > Z)
Evaluate the following expressions, using the values for R, S, P, U, and W as given. Note that T means true and F means false.R = F S = F P = F U = T W = T(a) (S OR P AND U) OR
Evaluate the following expressions, using the values for A, B, C, and D as given. Note that T means true and F means false.A = T B = T C = T D = F(a) A OR B OR C OR D(b) A OR (B OR (C
Evaluate the following expressions, using the values for W, X, Y, and Z as given. Note that T means true and F means false.W = T X = T Y = F Z = T(a) W OR X OR X AND Z(b) W OR X OR X
Evaluate the following expressions, using the values for J, K, L, and M as given. Note that T means true and F means false.J = F K = F L = T M = T(a) NOT J OR K AND L OR M(b) NOT J AND
Evaluate the following expressions, using the values for A, B, and C as given. Note that T means true and F means false.A = T B = F C = F D = T(a) A OR B OR C OR D(b) A AND B AND C AND
Write expressions equivalent to the following using a single relational operator:(a) (X > 1) AND (X > 5)(b) (X == 1) OR (X > 1)
Write expressions equivalent to the following without using the NOT operator:(a) NOT (N > 0)(b) NOT ((N >= 0) AND (N <= 5))
List three logical operators used in programming.
List the programming symbols for the relational operators.
Write a program segment that contains a single If-Then-Else statement and which inputs Num, then displays "Yes" if Num == 1 and displays "No" otherwise.
Write a program segment that contains two If-Then statements and which inputs Num, then displays "Yes" if Num == 1 and displays "No" otherwise.
Draw a flowchart that corresponds to Exercise 36.Data from Exercise 36Write a program segment that inputs Age, displays "Yes, you can vote" if Age is 18 or older and displays "You are too young to
Write a program segment that inputs Age, displays "Yes, you can vote" if Age is 18 or older and displays "You are too young to vote" if Age is less than 18, and displays nothing else. Remember to use
Draw a flowchart that corresponds to Exercise 34.Data from Exercise 34Write a program segment that inputs Age and displays "You are too young to vote" if Age is less than 18 (and displays nothing
Write a program segment that inputs Age and displays "You are too young to vote" if Age is less than 18 (and displays nothing else).
Suppose that X = 0. What is displayed when code corresponding to the following program segment is run? If X == 1 Then Write "Hi" Else Write "Why?" End If Write "Bye"
Give the ASCII code for each of the following strings, character by character:a. Why?b. Oh my!
If the string "}123*" is less than the string MyText (according to the ASCII code), with which character must MyText begin?
What character corresponds to each of the following ASCII codes?a. 33b. 65c. 126
Give the ASCII code for each of the following characters:(a) &(b) 2(c) @
In a menu-driven program, the options on the main menu often correspond to separate program modules.True or False
A menu-driven program requires the user to memorize a list of commands in order to select options offered by the program.True or False
A Case statement can be used to select an alternative based on the value of a variable of character type.True or False
If Name = "John", then Name >= "JOHN".True or False
If Name = "John", then Name > " John".True or False
If Char1 and Char2 are characters, then Char1 == Char2 if and only if their ASCII codes are the same.True or False
The ASCII coding scheme associates a number between 0 and 127 with every lowercase and uppercase letter as well as with other keyboard characters.True of False
If Num1 = 1 and Num2 = 2, determine whether each of the following expressions is true or false.(a) T F (Num1 == 1) OR (Num2 == 2) AND (Num1 == Num2)(b) T F ((Num1 == 1) OR (Num2 == 2)) AND (Num1 ==
If X = 0 and Response = "Yes", determine whether each of the following expressions is true or false.(a) T F (X == 1) OR (Response == "Yes")(b) T F (X == 1) AND (Response == "Yes")(c) T F NOT (X == 0)
If X = 1 and Y = 2 determine whether each of the following expressions is true or false.(a) T F X >= X OR Y >= X(b) T F X > X AND Y > X(c) T F X > Y OR X > 0 AND Y < 0(d) T F
If First = "Ann", determine whether each of the following expressions is true or false.(a) T F First == "ann"(b) T F First != "Ann"(c) T F First < "Nan"(d) T F First >= "Anne"
If X = 0, determine whether each of the following expressions is true or false.(a) T F X >= 0(b) T F 2 * X + 1 != 1
The term defensive programming refers to which of the following (select all that apply):a. Ensuring that input data are in the proper rangeb. Ensuring that a division by 0 does not take placec.
If Char1 = "/" and Char2 = "?", which of the following expressions are true? (select all that apply)a. Char1 6 Char2b. Char1 6 = Char2c. Char1 > Char2d. Char1 7 = Char2
A multiple-alternative structure cannot be implemented by using which of the following: (select all that apply)a. A single If-Then statementb. Several If-Then statementsc. Several If-Then-Else
Which expression is equivalent to the following expression:A > 8 AND A < 18a. NOT (A < 8) AND NOT (A > 18)b. NOT (A <= 8) AND NOT (A >= 18)c. NOT (A > 8 OR A < 18)d. A < 8
Which expression is equivalent to the following expression but does not use the NOT operator: NOT (A > B)a. A < Bb. A <= Bc. B < Ad. B <= A
Replace the blank with one of the following words: arithmetic, relational, or logical.!= is a(n) __________ operator
Replace the blank with one of the following words: arithmetic, relational, or logical.NOT is a(n) __________ operator
Write a program that allows the user to input a total dollar amount for an online shopping order and computes and outputs the shipping cost based on the following schedule: Order Total Ship within
Replace the blank with one of the following words: arithmetic, relational, or logical.OR is a(n) __________ operator
Replace the blank with one of the following words: arithmetic, relational, or logical.% is a(n) __________ operator
Replace the blank with one of the following words: arithmetic, relational, or logical.+ is a(n) __________ operator
Compute the income tax due on taxable income entered by the user, given the data as shown in the following table. Be sure to include error checking to make sure the user does not enter a negative
Consider the equation Ax2 + B = 0.● If B/A < 0, this equation has two solutions. The solutions are:(1) X1 = Sqrt(–B/A)(2) X2 = −Sqrt(–B/A)● If B/A = 0, this equation has one
Input a number (X) and create a program that allows the user to select finding the area (Area) of one of the following:● The area of a square with side X, Area = X * X● The area of a circle with
Replace the blank with one of the following words: arithmetic, relational, or logical.<= is a(n) __________ operator
Develop a menu-driven program that inputs two numbers and, at the user’s option, finds their sum, difference, product, or quotient.
A dual-alternative structure is also known as a(n) ____________ structure.
Input a number entered by the user and display "Positive" if it is greater than zero, "Negative" if it is less than zero, and "Zero" if it is equal to zero.
A single-alternative structure is also known as a(n) ____________ structure.
Give three examples of reasonable input data for testing this program.Suppose that you are asked to write a program that computes the average (mean) of three numbers entered by the user.
Construct a flowchart for this program (viewing it as a single module).Suppose that you are asked to write a program that computes the average (mean) of three numbers entered by the user.
Add pseudocode for the Input Data, Calculate Average, and Output Results modules to the pseudocode created in Review Exercise 37.Suppose that you are asked to write a program that computes the
Write pseudocode for the main module and Display Welcome Message module. You do not have to write pseudocode for the other three modules.Suppose that you are asked to write a program that computes
Draw a hierarchy chart for this program that reflects the following basic tasks:Display Welcome MessageInput DataCalculate AverageOutput ResultsSuppose that you are asked to write a program that
Give the input and output variables for this program.Suppose that you are asked to write a program that computes the average (mean) of three numbers entered by the user.
If you don’t use good programming style, then your programs will not run.True of False
A control structure is a means by which programmers control the user’s input.True of False
Structured programming is a method for designing and coding programs effectively.True of False
Which of the following is not an integer?a. −5b. 0c. 95842213d. 6.0
What is the decimal value of the 2 in the hexadecimal number F42AC16?a. 409610b. 51210c. 25610d. 210
Given the decimal number −954610. Convert the number to a 16-bit memory location in binary:a. using two’s complementb. using the formula (2x − |N|) where x is the number of bits and N is the
To debug a program means to correct its errors.True of False
Commercial programs, like those developed by Microsoft, do not normally require testing.True of False
If you are sure that you have coded a program correctly, then there is no need to test it.True of False
Step comments are intended to be read by someone using the program.True of False
Program comments are also known as external documentation.True of False
Showing 300 - 400
of 587
1
2
3
4
5
6