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.14E
Formulate a pseudocode
- Obtain two numbers from the keyboard, compute their sum and display the result.
- Obtain two numbers from the keyboard, and determine arid display which (if either) is the larger of the two numbers.
- Obtain a series of positive numbers from the keyboard, and determine and display their sum. Assume that the user types the sentinel value -1 to indicate “end of data entry.”
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Formulate a pseudocode algorithm for each of the following:a) Obtain two numbers from the keyboard, compute their sum and display the result.b) Obtain two numbers from the keyboard, and determine and display which (if either) isthe larger of the two numbers.c) Obtain a series of positive numbers from the keyboard, and determine and display theirsum. Assume that the user types the sentinel value -1 to indicate “end of data entry.”
In Java Language
Formulate a pseudocode algorithm for each of the following:
1-- Obtain two numbers from the keyboard, compute their sum and display the result.
2-- Obtain two numbers from the keyboard, and determine and display which (if either) of the two numbers is the larger.
3-- Obtain a series of positive numbers from the keyboard and determine and display their sum. Assume that the user types the sentinel value -1 to indicate “end of data entry.”
-Prompts the user to enter an integer x. Assume without error checking the user enters a positive integer.
-The program then will print all the odd integers between 1 and x that are a multiple of 3.
Sample:
Enter an integer x: 15
3 is a multiple of 3
9 is a multiple of 3
15 is a multiple of 3
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
Assume the file input.txt contains the following characters: What will the following program display on the scr...
Starting Out with C++: Early Objects
Why is the study of database technology important?
Database Concepts (8th Edition)
To use cout statements you must include the _____ file in your program.
Starting Out with C++: Early Objects (9th Edition)
What are the six common steps needed to access databases from a typical program?
Modern Database Management (12th Edition)
A ________ is a small window that displays information and allows the user to perform actions. a. menu b. confi...
Starting Out with Python (4th Edition)
How are relationships between tables expressed in a relational database?
Modern Database Management
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
- 3. Pseudocode, Algorithm & Flowchart to convert temperature from Fahrenheit to CelsiusC : temperature in CelsiusF : temperature Fahrenheit4. Pseudocode, Algorithm & Flowchart to find Area and Perimeter of SquareL : Side Length of SquareA : Area of SquareP : Perimeter of Squarearrow_forwardFinancial application: compute future apartment rent) Suppose that the rent for an apartment is $1000 thisyear and increases 3% every year. Write a program that computes the rent in five years and the total rent forone year starting five years from now.arrow_forward0199% 10:00 docs.google.com/forms 13 last constant Problem 1 At a certain university, students have to submit their exams online. The administration decides that for each minute of late submission, 5 points are deducted. Write a program that asks the user for his initial grade and how long he delayed in submitting, and then displays the final result. Sample Run 1: Enter your initial grade: 82 Enter the late submission time (in minutes) : 6 Your final grade is 52 Sample Run 2: Enter your initial grade: 115 Grades should be between 0 and 100 Sample Run 3: Enter your initial grade: 43 Enter the late submission time (in minutes): 10 Your final grade is 0 Sample Run 4: Enter your initial grade: 72 Enter the late submission time (in minutes) : -2 Time should be positive Your answer Problem 2 Write a Java program integers day. month, and vear. You are NOT required to check if the values entered by the user are in give the user the ability to determine the day of a given date. The user shall…arrow_forward
- Convert the algorithm provided into C source code: Each year, the county property tax system calculates and sends property tax bills to homeowners. Design a solution that allows the data entry clerk to enter property IDs and values into the system and displays the amount of tax due based on the tax rate of 3% . At the end of the program, display the total amount of potential tax revenue. To flag the end of the list of properties, enter the flag value of 0 when prompted for the property ID. Use a subfunction to calculate the amount of tax due on an individual property. Send the property value to the subfunction as an argument and return the amount of tax due.arrow_forwardQUESTION 1 PROBLEM: Write a program that prompts the user to input the amount of money that an ATM machine will dispense and then show the breakdown of how many 1000, 500, and 100 peso bill's are dispensed. The program must display the amount then prompt the user if the transaction will continue or not by choosing between Y (for Yes) and N (for No). If an invalid character is entered, it must display that the user entered an invalid character. The program must also display that the maximum allowable amount is 10,000 and the minimum allowable amount is 100. If the entered amount is greater than 10,000 or less than 100, an error notification must be displayed. Moreover, the entered amount must be exactly divisible by 100. SPECIFICATIONS: - You may only use the codes that we studied under our lectures All lines of codes should have a comment. - Save your cpp file as Surname - PE (Example: Pangaliman - PE.cpp) TEST CASES: If a user inputs an amount less than or equal to 10,000: REMINDER:…arrow_forwardFind the error in the following code. x=-10:1:10: y=-10:2:10: plot(x,y) No error O Syntax of plot is wrong O Length of x and y should be same Length of x and y should be different Plot is not available in MATLAB Oarrow_forward
- CODE FOR SINGLE-DIGIT CALCULATOR USING EMU8086 Write a program that would accept 2 single-digit numbers num1 and num2 (0-9) and an arithmetic operator (+, - , * and /). Perform arithmetic operations entered with num1 and num2. If the operator is invalid, display "Operation Error".arrow_forwardFind the error in the following pseudocode Display "Enter the length of the room." Input length Declare Integer lengtharrow_forwardDisplay the following CALCULATION OF VOLUMES[CHOICE] [SHAPE]1 Cuboid2 Sphere3 Cylinder4 Exit b. The user has to input the choice. Display the appropriate message when the user enters invalid input.c. Based on the choice entered, get the data required from the user and display the volume of the shape chosen.d. The program will loop again start from step 1. The process will only stop when the user enters choice 4 (The program will remain to loop if the enter choice is not 4).e. After the program exit from the loop, display the total_volume and average for all the shapes that has been calculated in the program.f. End the program by giving a closing message to the user.arrow_forward
- * Q-Find the error in the following code. x=-10:1:10; y=-10:2:10; plot(x,y) Plot is not available in MATLAB O Syntax of plot is wrong O Length of x and y should be same O No error O O هذا السؤال مطلوبarrow_forward(Numerical) Using the srand() and rand() C++ library functions, fill an array of 1000 floating-point numbers with random numbers that have been scaled to the range 1 to 100. Then determine and display the number of random numbers having values between 1 and 50 and the number having values greater than 50. What do you expect the output counts to be?arrow_forward(Electrical eng.) The combined resistance of three resistors connected in parallel, as shown in Figure 3.7, is given by this formula: combinedresistance=1(1 R 1 )(1 R 2 )(1 R 3 ) Using this formula, write a C++ program to calculate and display the combined resistance when the three resistors R1 = 1000, R2 = 1000, and R3 = 1000 are connected in parallel. The output should produce this display: The combined resistance is xxxx.xx ohms The xxxx.xx denotes placing the calculated value in a field width of seven columns, with two positions to the right of the decimal point.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE LProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Computational Software for Intelligent System Design; Author: Cadence Design Systems;https://www.youtube.com/watch?v=dLXZ6bM--j0;License: Standard Youtube License