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
Computer science
Input Forming----8.
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.
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
- Python Programmingarrow_forwardInstructions The program in the Programming Example: Fibonacci Number does not check: Whether the first number entered by the user is less than or equal to the second number and whether both the numbers are nonnegative. Whether the user entered a valid value for the position of the desired number in the Fibonacci sequence. Rewrite that program so that it checks for these things. NOTES: If an invalid number is entered for case 1 above, prompt the user to enter both numbers again. If an invalid number is entered for case 2, prompt the user to enter a value until a valid value is entered. the code: #include <iostream> using namespace std; int main() { //Declare variables int previous1; int previous2; int current; int counter; int nthFibonacci; cout << "Enter the first two Fibonacci numbers: "; //Step 1 cin >> previous1 >> previous2; //Step 2 cout << endl; //verify the first two values if(previous1<0 && previous2>0)…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(Conversion) Blood pressure is the force of blood circulating against the inner wall of blood vessels. It’s measured by two numbers: a systolic number that measures the pressure when the heart is contracting and a diastolic number that measures the pressure when the heart is resting. Both pressures are typically measured in millimeters of mercury (mm Hg) and given assystolic/diastolic numbers, such as 122/88. The National Heart, Blood, and Lung Institute provides the following guidelines for normal and high blood pressure measurements. Complete the chart by converting the measurements to atm and psi units.arrow_forward18. Tom and Jerry opened a new lawn service. They provide three types of services: mowing, fertilizing, and planting trees. The cost of mowing is $35.00 per 5,000 square yards, fertilizing is $30.00 per application, and planting a tree is $50.00. Write an algorithm that prompts the user to enter the area of the lawn, the number of fertilizing applications, and the number of trees to be planted. The algorithm then determines the billing amount. (Assume that the user orders all three services.) (9)arrow_forward
- (General math) The value of p can be approximated by this series: 4(113+1517+....) Using this formula, write a program that calculates and displays the value of , using 2, 3, and 4 terms of the series.arrow_forward(Misc. application) a. Write a program that continuously requests a grade to be entered. If the grade is less than 0 or greater than 100, your program should print an appropriate message informing the user that an invalid grade has been entered; else, the grade should be added to a total. When a grade of 999 is entered, the program should exit the repetition loop and compute and display the average of the valid grades entered. b. Run the program written in Exercise 2a and verify the program by using appropriate test data.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_forward
- (Mathematical functions) Write a program that calculates and displays values for y when y=xz/(xz) Your program should calculate y for values of x ranging between 1 and 5 and values of z ranging between 2 and 6. The x variable should control the outer loop and be incremented in steps of 1, and z should be incremented in steps of 1. Your program should also display the message Function Undefined when the x and z values are equal.arrow_forward(Data processing) a. Write a program to display the following two prompts: Enter a month (use a 1 for Jan, etc.): Enter a day of the month: Have your program accept and store a number in the variable month in response to the first prompt and accept and store a number in the variable day in response to the second prompt. If the month entered is not between 1 and 12, print a message informing the user that an invalid month has been entered. If the day entered is not between 1 and 31, print a message informing the user that an invalid day has been entered. b. What will your program do if the user enters a number with a decimal point for the month? How can you make sure your if statements check for an integer number? c. In a non-leap year, February has 28 days; the months January, March, May, July, August, October, and December have 31 days; and all other months have 30 days. Using this information, modify the program written in Exercise 3a to display a message when an invalid day is entered for a user-entered month. For this program, ignore leap years.arrow_forward(Civil eng.) Write a C++ program to calculate and display the maximum bending moment, M, of a beam that’s supported on both ends (see Figure 3.8). The formula is M=XW(LX)/L, where X is the distance from the end of the beam that a weight, W, is placed, and L is the beam’s length. You program should produce this display: The maximum bending moment is xxxx.xxxx The xxxx.xxxx denotes placing the calculated value in a field wide enough for four places to the right and left of the decimal point. For your program, assign the values1.2,1.3,and11.2toX,W,andL.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 PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE LNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
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
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
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
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Computational Software for Intelligent System Design; Author: Cadence Design Systems;https://www.youtube.com/watch?v=dLXZ6bM--j0;License: Standard Youtube License