MYPROGRAMMINGLAB WITH PEARSON ETEXT
8th Edition
ISBN: 9780134225340
Author: Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 2, Problem 2.9E
Write a single C statement or line that accomplishes each of the following:
- Print the message “Enter two number.”
- Assign the product of variables b and c to variable a.
- State that a
program performs a sample payroll calculation (i.e., use text that helps to document a program). - Input three integer values from the keyboard and place them in int variables a, b and c.
Expert Solution & Answer
Learn your wayIncludes step-by-step video
schedule05:07
Students have asked these similar questions
IZVO @
۲:۱۰ م
50
EETE2102-Electronics-... :puäillu | E
هل تريد الانضمام إلى هذا الجهاز؟
الانضمام
Moodle
Write a program in C that accepts:
1. the radius of a sphere in a variable say radius,
2. The choice (in a character variable choice) .If
the choice is a, area of sphere should be found
else the volume of the sphere should be found.
area of a sphere is given by the formula: area=4 x
TT x radius? and
the volume of the sphere is given by the formula:
volume=4/3 x radius3
Note: Create/Use appropriate header files,
constants and functions
Sample Output 1:
Enter the radius of the sphere :1
Enter choice: a for area of sphere
an
Volume of sphere is 4.186667
Question:
A country charges income tax as follows based on one's gross salary. No tax is charged on the
first 20% of salary. The remaining 80% is called taxable income. Tax is paid as follows:
10% on the first $15,000 of taxable income;
20% on the next $20,000 of taxable income;
25% on all taxable income in excess of $35,000;
Write a program to read a value for a person's salary and print the amount of tax to be paid in
dollars.
.
●
.
Additionalind.
C-Program for blood pressure.
The program (screenshot below) compares the systolic & diastolic measurements to output whether the blood is (low, ideal, pre-high, or high)
The code I wrote is able to successfully determine the blood pressure type as long as it lies within the same range.
However, if it goes outside that range it prints an error.
FOR EXAMPLE**** PLEASE READ*** If the user inputs their systolic variable as 100 and their systolic as 90, it will print an error.
If the systolic & diastolic measurements are vastly different the program prints an error, if you could help resolve this issue it would be greatly appreciated.
Chapter 2 Solutions
MYPROGRAMMINGLAB WITH PEARSON ETEXT
Ch. 2 - Identify and correct the errors in each of the...Ch. 2 - Fill in the blanks in each of the following: _____...Ch. 2 - Write a single C statement or line that...Ch. 2 - State which of the following are true and which...Ch. 2 - Prob. 2.11ECh. 2 - What, if anything, prints when each of the...Ch. 2 - Which, if any, of the following C statements...Ch. 2 - Given the equation y=ax3+7, which of the...Ch. 2 - State the order of evaluation of the operators in...Ch. 2 - (Arithmetic) Write a program that asks the user to...
Ch. 2 - (Printing Values with print!) Write a program that...Ch. 2 - (Comparing Integers) Write a program that asks the...Ch. 2 - (Arithmetic, Largest Value and Smallest Value)...Ch. 2 - (Diameter, Circumference and Area of a Circle)...Ch. 2 - Prob. 2.21ECh. 2 - What does the following code print? printf( *\n) ;Ch. 2 - (Largest and Smallest Integers) Write a program...Ch. 2 - (Odd or Even) Write a program that reads an...Ch. 2 - Print your initials in block letters down the...Ch. 2 - (Multiples) Write a program that reads in two...Ch. 2 - (Checkerboard Pattern of Asterisks) Display the...Ch. 2 - Prob. 2.28ECh. 2 - (Integer Value of a Character) Heres a peek ahead....Ch. 2 - (Separating Digits in an Integer) Write a program...Ch. 2 - (Table of Squares and Cubes) Using only the...Ch. 2 - (Body Mass Index Calculator) We introduced the...Ch. 2 - Prob. 2.33MD
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
The same rules for naming variables apply to naming classes.
Starting out with Visual C# (4th Edition)
What limitation does a static member function have?
Starting Out with C++ from Control Structures to Objects (9th Edition)
What is the highest decimal number that can be represented by each of the following numbers of binary digits (b...
Digital Fundamentals (11th Edition)
What is the disadvantage of having too many features in a language?
Concepts of Programming Languages (11th Edition)
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
Revise the loop shown in Listing 4.6 to use a break statement instead of the boolean variable areMore. Comment ...
Java: An Introduction to Problem Solving and Programming (8th 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
- Hi All, Need help with this homework question. All coding is in Python. 1.) Rectangle Area The area of a rectangle is calculated according to the following formula: Area= Width * Length Design a function that accepts a rectangle's width and length as arguments and returns the rectangle's area. Use the function in a program that prompts the user to enter the rectangle's width and length, and then displays the rectangle's area. All coding is done in Python.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(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
- (Numerical) a. Write a C++ program that accepts an integer argument and determines whether the passed integer is even or odd. (Hint: Use the % operator.) b. Enter, compile, and run the program written for Exercise 8a.arrow_forwardCreate a four-function calculator for fractions by using following formulas. a) Addition: a/b + c/d = (a*d + b*c) / (b*d) b) Subtraction: a/b - c/d = (a*d - b*c) / (b*d) Note:The program should display above mentioned formulas first. The user should take the values of a, b, c, d from user. The program should then display the result of each process Addition, Subtraction, Multiplication, and Division on separate lines on screen.arrow_forward3. Steven bought 375 shares of stock at a price of RM35.00 per share. He must pay her stockbroker a 2 percent commission for the transaction. Write a program that calculates and displays the following: a. The amount paid for the stock alone (without the commission) b. The amount of the commission c. The total amount paid (for the stock plus the commission) Note : You are required to use constant variable in the program for related variable.arrow_forward
- 5) Write a program to determine the number of thousands, hundreds, tens, and ones in a given integer number (You can use integer division and modulus). For example, if you entered 8532, the program will print 8 thousand, 5 hundred, 3 tens and 2 ones. Then, let the program print the number on the screen in a reverse way as 2358 and print its double as well (2* 2358) 4716.arrow_forwardBody Mass Index (BM) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters. Interpretation Underweight Write a program which prompts the user to enter the weight in kgs (integer value) and height in feet and inches (both integers) and then calculates the BMI of the person. Your program first need to convert inches to meters (L.e. inches 0.0254) and then use the following formula to calculate BM weight kilogram/ (height meter) 2 5 Your program displays the BMI value in two decimal places and the corresponding status as shown in the examples below. Note that one inch is 0.0254 meters and 1 foot is 12 inches. For example: Input Result 62 10 89 6 45 BMI BMI < 18.5 185 BMI <25.0 25.0 < BMI <30.0 30.0 s BMI 5 7 Normal Overweight Obese 82 2 Enter weight (kg): Enter height (feet): Enter height (inches): BMI is 19.61, Normal Enter weight (kg): Enter height (feet): Enter height (inches): BMI is 26.61,…arrow_forwardWrite a program that performs the following: 1) request a full name input by the user 2) display the first name 3) display the last name 4) display the initial in the format shown in the example output Input text can be any content. Just make sure to precisely match the output format below. Write your entire program in the ANSWER area provided below (must include comments if using code is not covered in the course). Example Output Enter your full name (first and last): Tom CatFirst Name: TomLast Name: CatInitial: T.C.arrow_forward
- Please send me answer within 10 min!! I will rate you good for sure!! Please solve in C language with proper explanation. The cost to ship a package is a flat fee of 75 cents plus 25 cents per pound.1. Declare a const named CENTS_PER_POUND and initialize with 25.2. Get the shipping weight from user input storing the weight into shipWeightPounds. (Remember %d is used to read in an integer from the user.)3. Using FLAT_FEE_CENTS and CENTS_PER_POUND constants, assign shipCostCents with the cost of shipping a package weighing shipWeightPounds.IN C: #include <stdio.h> int main(void) {int shipWeightPounds;int shipCostCents = 0;const int FLAT_FEE_CENTS = 75; /* Your solution goes here */ printf("Weight(lb): %d, Flat fee(cents): %d, Cents per pound: %d\nShipping cost(cents): %d\n",shipWeightPounds, FLAT_FEE_CENTS, CENTS_PER_POUND, shipCostCents); return 0;}arrow_forwardH. WI Write a program to find average of three numbers x, y, z where x =10, y-20, and z= 30. H. W2 Write a Q. BASIC program to find the value of from the following equation: x2+2a3+sin x Y for any value of x, a, k, r. ex-kr-3arrow_forwardPRG10: Write a program that accepts dates written in numerical form and outputs in complete form. :5 26 1986 : May 26, 1986 Enter date in number form Your date in complete form is PRG11: Write a program that will calculate and show bills of the Manila Electric Company. The rates vary depending on whether the useR is residential (R), commercial( C) , or industrial (I). Any other code should be treated as an error. The program should accept the subscriber ID, Subscriber Name, his total electrical consumption in a month, and the code of the consumer type. The rates are computed as follows: R: 50 plus .50 per kwh used C: 100 for the first 1000 kwh and 0.45 for each additional kwh I: 180 for the first 1000 kwh and 0.75 for each additional kwh PRG12: Write a program that will simulate the Paper, Rock, Scissors game. Two players should be able to either P, R or S then the program shall determine who the winner is and state why he wins based on the following criteria: Sample Output Paper…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 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