MYPROGRAMMINGLAB WITH PEARSON ETEXT
8th Edition
ISBN: 9780134225340
Author: Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 3, Problem 3.13E
Write a single pseudocode statement that indicates each of the following:
- Display the message “Enter two numbers”.
- Assign the sum of variables x, y, and z to variable p.
- The following condition is to be tested in an if ... else selection statement: The current value of variable m is greater than twice the current value of variable v.
- Obtain values for variables s, r, and t from the keyboard.
Expert Solution & Answer
Learn your wayIncludes step-by-step video
schedule06:34
Students have asked these similar questions
Write a single pseudocode statement that indicates each of the following:a) Display the message "Enter two numbers".b) Assign the sum of variables x, y, and z to variable p.c) The following condition is to be tested in an if…else selection statement: The currentvalue of variable m is greater than twice the current value of variable v.d) Obtain values for variables s, r, and t from the keyboard.
Conditional Statements - Practice Questions
• Write a python program to accept a number and
o if the number is equal to 1, calculate Z = x % y
o if the number is equal to 2, calculate Z = x // y
o if the number is equal to 3,
or negative
o
equal to 4,
if the number is
odd
o
if the number is equal to 5,
not same
o
if the number is equal to 6,
two numbers
o if the number is equal to 7,
two numbers
o Otherwise print STOP
check if the number is positive
check if the number is even or
check if two numbers are same or
check the greatest number among
check the smallest number among
Conditional Statements - Practice Questions
• Write a python program to accept a number and
if the number is even calculate Z=x modulus y,
If number is positive calculate Z=x to the power y
If number is in between 1 and 10 calculate Z- (x+y)/2
If the number is equal to 0 calculate division of two numbers
by removing decimal.
Otherwise display Wrong input
ㅇ
• write a python program to accept 2 numbers,
if two numbers are same calculate Z=a²+b²,
oif modules of two number is equal to zero
Z=(2a5+3b5) /3b,
if both the numbers are even calculate Z-(a+b)?/(a*b),
otherwise display Wrong Choice.
calculate
Chapter 3 Solutions
MYPROGRAMMINGLAB WITH PEARSON ETEXT
Ch. 3 - Indentify and correct the errors in each of the...Ch. 3 - Fill in the blanks in each of the following: The...Ch. 3 - Prob. 3.12ECh. 3 - Write a single pseudocode statement that indicates...Ch. 3 - Formulate a pseudocode algorithm for each of the...Ch. 3 - State which of the following are true and which...Ch. 3 - For Exercises 3.16-3.20, perform each of these...Ch. 3 - For Exercises 3.16 -3.20, perform each of these...Ch. 3 - (Sales-Commission Calculator) One large chemical...Ch. 3 - (Interest Calculator) The simple interest on a...
Ch. 3 - (Salary Calculator) Develop a program that will...Ch. 3 - (Predecrementing vs. Postdecrementing)Write a...Ch. 3 - (Printing Numbers from a Loop) Write a program...Ch. 3 - (Find the Largest Number) The process of finding...Ch. 3 - (Tabular Output) Write a program that uses looping...Ch. 3 - (Tabular Output) Write a program that utilizes...Ch. 3 - (Find the Two Largest Numbers) Using an approach...Ch. 3 - (Validating User Input) Modify the program in...Ch. 3 - Prob. 3.28ECh. 3 - Prob. 3.29ECh. 3 - (Dangling-Else Problem) Determine the output for...Ch. 3 - (Another Dangling-Else Problem) Modify the...Ch. 3 - Prob. 3.32ECh. 3 - (Hollow Square of Asterisks) Modify the program...Ch. 3 - (Palindrome Tester) A palindrome is a number or a...Ch. 3 - (Printing the Decimal Equivalent of a Binary...Ch. 3 - (How Fast Is Your Computer?) How can you determine...Ch. 3 - (Detecting Multiples of 10) Write a program that...Ch. 3 - (Counting 7s) Write a program that reads an...Ch. 3 - (Checkerboard Pattern of Asterisks) Write a...Ch. 3 - (Multiples of 2 with an Infinite Loop) Write a...Ch. 3 - (Diameter, Circumference and Area of a Cirle)...Ch. 3 - Whats wrong with the following statement? Rewrite...Ch. 3 - (Sides of a Triangle) Write a program that reads...Ch. 3 - (Sides of a Right Triangle) Write a program that...Ch. 3 - (Factorial) The factorial of a nonnegative integer...Ch. 3 - (World-Population-Growth Calculator) Use the web...Ch. 3 - (Target-Heart-Rate Calculator) While exercising,...Ch. 3 - (Enforcing Privacy with Cryptography) The...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Compile and run the sample code that uses show_bytes (file show-bytes. c) on different machines to which you ha...
Computer Systems: A Programmer's Perspective (3rd Edition)
Design a nested loop that displays 10 rows of # characters. There should be 15 # characters in each row.
Starting Out with Programming Logic and Design (4th Edition)
Translate the following Python program into the Vole machine language described in Appendix C. X = 0 while (X ...
Computer Science: An Overview (12th Edition)
Which operator must be overloaded in a class before the class can be used to create function objects?
Starting Out with C++ from Control Structures to Objects (9th Edition)
True or false? You can override a static method defined in a superclass.
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
The ________ object is assumed to exist and it is not necessary to include it as an object when referring to it...
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
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
- (Physics) Coulomb’s Law states that the force, F, acting between two electrically charged spheres is given by this formula: F=kq1q2r2 q1isthechargeonthefirstsphere.q2isthechargeonthesecondsphere.risthedistancebetweenthecentersofthetwospheres.kisaproportionalityconstant. Write an assignment statement to calculate the force, F.arrow_forwardIf the following code segment compiles correctly, what do you know about the variable x? if(x) WriteLine(OK); a. x is an integer variable. b. x is a Boolean variable. c. x is greater than 0. d. none of thesearrow_forward(Data processing) Years that are evenly divisible by 400 or are evenly divisible by 4 but not by 100 are leap years. For example, because 1600 is evenly divisible by 400, 1600 was a leap year. Similarly, because 1988 is evenly divisible by 4 but not by 100, it was also a leap year. Using this information, write a C++ program that accepts the year as user input, determines whether the year is a leap year, and displays a message telling the user whether the entered year is or is not a leap year.arrow_forward
- 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }arrow_forwardRewrite the following statements using augmented assignment operators.a. x = x + 1b. x = x * 2c. x = x / 10d. x = x − 100arrow_forward1. An if selection statement executes if and only if: A. the Boolean condition evaluates to false. B. the Boolean condition evaluates to true. C. the Boolean condition is short-circuited. D. none of the above. Answer: 2.A compound statement is enclosed between: A. [ ] B. { } C. ( ) D. < > Answer: 4. The controlling expression for a switch statement includes all of the following types except: A. char B. int C. byte D. double Answer:arrow_forward
- 2. Assume x, y and z are integer variables with x = 2, y = 5 and z = 10. Each expressionis independent. Determine the results of the following statements and show the step toevaluate them:arrow_forwardIn Java Language Write a single pseudocode statement that indicates each of the following: 1--Display the message "Enter two numbers". 2-- Assign the sum of variables x, y, and z to variable p. 3-- Test the following condition in an if…else selection statement: The current value of variable m is greater than twice the current value of variable v.arrow_forwardComplete Answerarrow_forward
- Submit your answer in the comment section. Days of the Week Write a program that asks the user for a number in the range of 1 through 7. The program should display the corresponding day of the week, where 1- Monday. 2- Tuesday and so forth. If the user types in a 6 then "Saturday should be printed on the screen. For help with Input statements see: Input Function • The program should print an error message if the user enters a number that is outside the range of 1 through 7. For help with If statements and conditions see the following pages: If-Eke Statements and Operators • Name the source code file yourName HW4_1.py. • Test and run the program. Capture the output console and save it as an image file named yourName Hw3 output4 1jpg. • Submit the py and the image files through Canvas.arrow_forwardQ1) Write the pseudocode for the following. a. Ask a user to enter a number. If the number is between 0 and 10, write the word blue.If the number is between 10 and 20, write the word red. If the number is between 20and 30, write the word green. If it is any other number, write that it is not a correctcolour option. b. Ask user to enter weight. Program will only display status “You’re obese” if theweight is more than 100kg. c. Modify above question. Program will display status based on below condition: weight >100kg, status= “Obese” weight < 30kg, status= “Underweight” others, status = “Normal” Q2) Find the complexity of the following codea. for (cnt2 = 0, i = 1; i<=n;i++)for (j = 1; j <= i; j++)cnt2++; b. for (cnt3 = 0, i = 1; i<=n;i*2)for (j = 1; j <= n; j++)cnt3++; c. for (cnt4 = 0, i =1;i<=n;i*=2)for (j = 1; j <= i; j++)cnt4++; d. for (i = 0; i<n;i++)for (j=0;j<n;j++)a[i][j] = b[i][j] + c[i][j]; e. for (i = 0; i<n;i++)for (j = 0; j <j++)for (k…arrow_forwardThe following statements allows conditional execution is: if statement False Truearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Introduction to Operators in C; Author: Neso Academy;https://www.youtube.com/watch?v=50Pb27JoUrw;License: Standard YouTube License, CC-BY