C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey 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
1. 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:
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:
Complete Answer
Chapter 3 Solutions
C How to Program (8th Edition)
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 int x = 10;, int y = 7;, double z = 4.5;, and double w = 2.5;, evaluate each of the following statements, if possible. If it is not possible, state the reason. (3, 4) (x + y) % x x % y + w (z - y) / w (y + z) % x (x % y) * z x % y % 2 (x + y) % z (x % y + z) / warrow_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_forward4. 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_forwardSubmit 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_forward
- 3. The formula for determining compound interest is: A represents the amount to earn; P is the principle that is initially invested; r is the interest rate earned; n is the number of times the interest is compounded; and t is the number of time periods for the investment. Write a program that prompts the user to enter P, r, n and t. The program should output the amount earned on the investment. 4. Look up the Pythagorean theorem if you are not already familiar with it. Use the following formula to solve for c in the formula: c = √a2 + b2. Use the proper functions from the cmath header file. Be sure to output the result.larrow_forwardThe following statements allows conditional execution is: if statement False Truearrow_forward31. If originally x=4, what is the value of x after the evaluation of the expression: x++arrow_forward
- C-PROGRAM:: Q3arrow_forwardWrite algorithms to solve different programming problems using flowchart and pseudo-code. Problem: The program will display the following when run: 1. Display Pass/Fail Data 2. Display Final Grade Classification 3. Display Mean and Median Score Call the following function when the user selects from the menu: 1. Determine the number of students who passed (>=75%) and failed (<75%). Plot also the pass/fail data using a pie chart. 2. Classify and plot (using bar graph) the final grades based on the following: - Expert (95%-100%) - Competent (85%-94%) - Novice (75%-84%) - Beginner (<75%) 3. Calculate the mean and median final grade. Plot the mean and median score with the plot of all the final grades. Create an algorithm for the programming problem above using pseudo-code or flowchart.arrow_forwardUse C++ Codingarrow_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