Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
5th Edition
ISBN: 9780134801155
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 4.3, Problem 4.11CP
If the following pseudocode were an actual
If "z" < "a" Then
Display "z is less than a."
Else
Display "z is not less than a."
End If
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
1. If the following pseudocode were an actual program, why would it not display the output that the programmer expects?
Declare String favoriteFood
Display "What is the name of your favorite food?"
Input favoriteFood
Display "Your favorite food is "
Display "favoriteFood"
5. Find the error in the following pseudocode.
Declare Real pi
Set 3.14159265 = pi
Display "The value of pi is ", pi
Ask for a letter (whether lowercase or uppercase) then display a name that starts with the entered letter. If a number is entered, it must display a message that only letters (A- J, a-j) are allowed. The program will keep asking for a letter until 0 (zero) is pressed. Enter a letter (0 to end program): a Aubrey Enter a letter (0 to end program): 5 Please enter a valid letter (A-Z, a-z). Enter a letter (0 to end program): A Aubrey Enter a letter (0 to end program): 0 e.g. Bye
In Python, Assuming minors are younger than 13 and adults are older than 19, write a program that prompts the user to enter his/her age and then reports whether the user is a minor, teenager, or adult
Plan each program by writing pseudocode. Write all of your pseudocode as comments immediately after your name and 2380093
Add more comments as needed in each program to explain your code.
Choose descriptive variable names in all programs.
Currency format. There should be no space between the $ sign and the first digit. See sep on page 66 to cancel the space automatically added when print items are separated by commas. Display commas as needed for values over $1,000.
Chapter 4 Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Ch. 4.1 - What is a control structure?Ch. 4.1 - What is a decision structure?Ch. 4.1 - Prob. 4.3CPCh. 4.1 - Prob. 4.4CPCh. 4.1 - What types of relationships between values can you...Ch. 4.1 - Write a pseudocode If-Then statement that assigns...Ch. 4.1 - Write a pseudocode If-Then statement that assigns...Ch. 4.2 - Prob. 4.8CPCh. 4.2 - What statement do you use in pseudocode to write a...Ch. 4.2 - When you write an If-Then-Else statement, under...
Ch. 4.3 - If the following pseudocode were an actual...Ch. 4.3 - If the following pseudocode were an actual...Ch. 4.4 - Prob. 4.13CPCh. 4.4 - What statement do you use in pseudocode to write a...Ch. 4.4 - When you write an If-Then-Else statement, under...Ch. 4.4 - Convert the following pseudocode to an...Ch. 4.5 - Prob. 4.17CPCh. 4.5 - How do you write a multiple alternative decision...Ch. 4.5 - What does the case structure test, in order to...Ch. 4.5 - You need to write a multiple alternative decision...Ch. 4.6 - Prob. 4.21CPCh. 4.6 - Prob. 4.22CPCh. 4.6 - Assume the variables a = 2, b = 4, and c = 6....Ch. 4.6 - Explain how short-circuit evaluation works with...Ch. 4.6 - Prob. 4.25CPCh. 4.6 - Write an If-Then statement that displays the...Ch. 4.7 - Prob. 4.27CPCh. 4.7 - What is a flag variable?Ch. 4 - A __ structure can execute a set of statements...Ch. 4 - A __ structure provides one alternative path of...Ch. 4 - In pseudocode, the If-Then statement is an example...Ch. 4 - A(n) __ expression has a value of either true or...Ch. 4 - The symbols,, and== are all __ operators. a....Ch. 4 - A(n) __ structure tests a condition and then takes...Ch. 4 - You use a(n) __ statement in pseudocode to write a...Ch. 4 - You use a(n) _________ statement in pseudocode to...Ch. 4 - A ______ structure allows you to test the value of...Ch. 4 - Prob. 10MCCh. 4 - AND, OR, and NOT are _____ operators. a....Ch. 4 - A compound Boolean expression created with the...Ch. 4 - A compound Boolean expression created with the...Ch. 4 - The ____ operator takes a Boolean expression as...Ch. 4 - A ________ is a Boolean variable that signals when...Ch. 4 - Prob. 1TFCh. 4 - A program can be made of only one type of control...Ch. 4 - A single alternative decision structure tests a...Ch. 4 - A decision structure can be nested inside another...Ch. 4 - A compound Boolean expression created with the AND...Ch. 4 - Explain what is meant by the term conditionally...Ch. 4 - You need to test a condition and then execute one...Ch. 4 - If you need to test the value of a variable and...Ch. 4 - Briefly describe how the AND operator works.Ch. 4 - Briefly describe how the OR operator works.Ch. 4 - Prob. 6SACh. 4 - What is a flag and how does it work?Ch. 4 - Design an If-Then statement (or a flowchart with a...Ch. 4 - Design an If- Then statement (or a flowchart with...Ch. 4 - Design an If- Then-Else statement (or a flowchart...Ch. 4 - The following pseudocode contains several nested...Ch. 4 - Design nested decision structures that perform the...Ch. 4 - Rewrite the following If-Then-Else If statement as...Ch. 4 - Design an If-Then-Else statement (or a flowchart...Ch. 4 - Design an If-Then-Else statement (or a flowchart...Ch. 4 - Design a case structure that tests the month...Ch. 4 - Write an If-Then statement that sets the variable...Ch. 4 - Part of the following pseudocode is incompatible...Ch. 4 - Prob. 2DECh. 4 - Prob. 3DECh. 4 - Roman Numerals Design a program that prompts the...Ch. 4 - Areas of Rectangles The area of a rectangle is the...Ch. 4 - Mass and Weight Scientists measure an objects mass...Ch. 4 - Magic Dates The date June 10, 1960, is special...Ch. 4 - Color Mixer The colors red, blue, and yellow are...Ch. 4 - Book Club Points Serendipity Booksellers has a...Ch. 4 - Software Sales A software company sells a package...Ch. 4 - Change for a Dollar Game Design a change-counting...Ch. 4 - Shipping Charges The Fast Freight Shipping Company...Ch. 4 - Body Mass Index Program Enhancement In Programming...Ch. 4 - Time Calculator Design a program that asks the...Ch. 4 - Leap Year Detector Design a program that asks the...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
For each of the following activities, give a PEAS description of the task environment and characterize it in te...
Artificial Intelligence: A Modern Approach
When a program works with an input file, a special value known as a(n) __________ is internally maintained for ...
Starting out with Visual C# (4th Edition)
Write a loop equivalent to the for loop above without using .
C Programming Language
In programming we use the term string to mean _____. a. many lines of code b. parallel memory locations c. stri...
Starting Out With Visual Basic (7th Edition)
Add a close method to the Auction class. This should Iterate over the collection of lots and print out details ...
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Using examples, illustrate the different types of adaptor needed to support sequential composition, hierarchica...
Software Engineering (10th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
Assume that a runner runs 15 kilometers in 50 minutes and 30 seconds. Write a program that displaysthe average speed in miles per hour. (Note that 1 mile is 1.6 kilometers.).
Note: You have to replace the question mark with the correct answer.
arrow_forward
Solve it using pseudocode (no python syntax allowed)
Code it in Python - must use decision structure and conditional loop
Auto Insurance Problem
Write a program that prompts the user for his/her age and marital status. Use the following menu for the user to choose marital status:
Married
Single
Then calculate and display a rate for auto insurance using the following rules:
Age
Married
Rate
Less than 25
No
$800.00
Less than 25
Yes
$700.00
Greater than or equal to 25
No
$500.00
Greater than or equal to 25
Yes
$450.00
Input validation: The user must choose a valid choice from the menu and the user’s age must be at least 16.
Use try ... except to make error statements for TypeError and NameError.. ( FOR PYTHON)
PLEASE I NEED THE PSEUDOCODE FOR THIS AS WELL
arrow_forward
In Python, Assuming minors are younger than 13 and adults are older than 19, write a program that prompts the user to enter his/her age and then reports whether the user is a minor, teenager, or adult.
Start each program with your name and ID# in a comment.
Plan each program by writing pseudocode. Write all of your pseudocode as comments immediately after your name and SPC ID#.
Add more comments as needed in each program to explain your code.
Choose descriptive variable names in all programs.
Currency format. There should be no space between the $ sign and the first digit. See sep on page 66 to cancel the space automatically added when print items are separated by commas. Display commas as needed for values over $1,000.
arrow_forward
Create the pseudocode for a program that are able to measure or sense the car speed in kilometers per hour, and then, convert the speed in miles per hour (mph). The program also display the speed in km/h. If the driver exceed the speed limit of 110km/h, program will warn the driver through display with the message ‘PLEASE REDUCE SPEED’. Otherwise, the message ‘NORMAL’.
arrow_forward
Make a pseudocode and flowchart
1. Get student name
2. If the student is regular, you should get student's section and display student's name and section
3. If the student is irregular, you should get student's course and display student's name and course
arrow_forward
The company « Super discounted used cars inc.» pays their employees according to this chart: 250$ per months plus 50$ per car sold. If the salesman sells more than 10 cars, the employee receives a bonus of 5% of the total of his sales, in addition to his regular salary.
Each month, the owner sits in front of the computer, and enters the following information: The name of the employee, the number of cars sold, as well as the total of all the sales for the month.
Write an algorithm that will calculate the salary of an employee for the month, and then display on the screen, his name, total cars sold, base salary, bonus if applicable and entire salary.
arrow_forward
Create a program in such a way that if the valuation of investments in the last 4 weeks had decreased, he will add ten thousand pesos,otherwise, he would withdraw a sum of five thousand pesos. Create a pseudocode for the envisioned program. Your pseudocode must also tell whether to invest again or withdraw given the information of the present and last four-week value of investment. (python pseudocode)
arrow_forward
If the following pseudocode wer an actual program, why would it not display the output that the programmer expects?
Declare String favoriteFood
Display "What is the name of your favorite food?"
Input favoriteFood
Display "your favoite food is "
Display "favoriteFood"
arrow_forward
This pseudocode segment is intended to compute and display the average grade of three
tests for any number of students.
The program executes until the user enters a negative value for the first test score.
Debug the pseudocode by rewriting it to achieve its intended purpose.
start
Declarations
num test1
num test2
num test3
num average
housekeeping()
while test1 >= 0
mainLoop()
endwhile
endOfJob()
stop
housekeeping()
output "Enter score for test 1 or a negative number to quit"
return
mainLoop()
output "Enter score for test 2"
input test2
average = (test1 + test2 + test3) / 3
output "Average is ", average
output "Enter score for test 1 or a negative number to quit"
input tesst1
return
endOfJob()
output "End of program"
return
arrow_forward
Write the IPO CHART and Pseudocode.
Write a program that will compute the total amount of a dress. The original price of the dress is 150 pesos. The discount rate is 5%. Display the total amount of the dress after discount.
arrow_forward
Assuming there are no deposits other than the original investment, the balance in a saving account after one year may be calculated as
Amount=Principal * (1+ Rate / T)T
principal -balance in the saving account,
Rate -the interest rate,
T - number of times the interest is compounded during a year.
Write a program that asks for :
the principal, the interest rate, and the number of times the interest is compounded. It should display a report similar to
Interest Rate: 4.25%
Times Compounded: 12
Principal: $ 1000.00
Interest: $ 43.34
Amount in Savings: $ 1043.34
arrow_forward
(Science: calculating energy) Write a program that calculates the energy needed to heat water from an initial temperature to a final temperature. Your program should prompt the user to enter the amount of water in kilograms and the initial and final temperatures of the water. The formula to compute the energy is Q = M * (finalTemperature – initialTemperature) * 4184 where M is the weight of water in kilograms, temperatures are in degrees Celsius, and energy Q is measured in joules.
arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY