C++ How To Program Plus Mylab Programming With Pearson Etext -- Access Card Package (10th Edition)
10th Edition
ISBN: 9780134583006
Author: Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Q1) An accountant works for a company and there is a need for a C program to calculate the
average income of fifteen employees after cutting tax from it. Write a program that takes the
gross income of the 15 employees using scanf and check the tax range using the given table
below. Use repetition structure (while or for loop) to calculate the salary of each entployee and
iffelse statements to select the salary based on the gross income. Besides, find the sum of all
the salaries and print the average salary for fifteen employees. The formulation for calculating
the salary is shown below:
Salary = Gross Income
Salary = GrossIncome - GrossIncome 0.05
Salary = GrossIncome - Grosslncome 0.10
GrossIncome < 500$
500$ < GrossIncome < 700$
700$ < GrossIncome < 1000$
1000$ < GrossIncome
Salary =
Salary = GrossIncome - GrossIncome 0.15
C language
CODE USING C++
3. Place Values
by CodeChum Admin
Manipulating values from a series of numbers is fun, but let's try exploring the use of loops a little more.
How about printing out each digit of a number by place values, in ascending order?
Instructions:
Create a variable and input a random positive integer.
Using while loop, print out each digit of the inputted integer in separate lines, starting from its rightmost digit until the leftmost digit of the number. Tip: Use % 10 to get the rightmost digit, and / 10 to remove it from the number.
Another tip: don't forget to consider the case wherein the input is `0`
Input
A line containing an integer.
214
Output
Multiple lines containing an integer.
4 1 2
Complete answer
Chapter 5 Solutions
C++ How To Program Plus Mylab Programming With Pearson Etext -- Access Card Package (10th Edition)
Ch. 5 - Describe the four basic elements of...Ch. 5 - Compare and contrast the while and for iteration...Ch. 5 - Prob. 5.7ECh. 5 - Compare and contrast the break and continue...Ch. 5 - (Find the Code Errors) Find the error (s), if any,...Ch. 5 - Prob. 5.10ECh. 5 - (Find the Smallest Value) Write an application...Ch. 5 - (Calculating the Product of Odd Integers) Write an...Ch. 5 - (Factorials) Factorials arc used problems. The...Ch. 5 - (Modified Compound-Interest Program) Modify the...
Ch. 5 - (Triangle-Printing program)Write an application...Ch. 5 - (Bar- Chart Printing Program) One interesting...Ch. 5 - (Calculating Sales) An online retailer sells five...Ch. 5 - Assume thati = 1, j = 2, k = 3and m = 2. What does...Ch. 5 - (Calculate the value of ) Calculate the value of ...Ch. 5 - (Pythagorean Triples) A right triangle can have...Ch. 5 - (Modified Triangle-Printing Program) Modify...Ch. 5 - (De Morgan`s Laws)In this chapter, we discussed...Ch. 5 - (Diamond -Printing Program) Write an application...Ch. 5 - (Diamond -Printing Program) Write an application...Ch. 5 - Removing break and continue) A criticism of the...Ch. 5 - Prob. 5.26ECh. 5 - Replacing continue with a structured Equivalent)...Ch. 5 - Prob. 5.28ECh. 5 - (Peter Minuit Problem) Legend has it that, in...Ch. 5 - (Dollar Amount Constructor with Two Parameters)...Ch. 5 - (Dollar Amount Arithmetic) Enhance class Dollar...Ch. 5 - Prob. 5.32ECh. 5 - (Dollar Amount with dollars cents Data Members)...Ch. 5 - (Account Class That Stores a Dollar Amount)...Ch. 5 - (Displaying the Interest Rate in the Dollar Amount...Ch. 5 - (Showing That double Values Are Approximate)...Ch. 5 - (Global Warming Facts Quiz) The controversial...Ch. 5 - (Global Warming Facts Quiz) The controversial...Ch. 5 - (Tax Plan Alternatives: The "Fair' Tax") There are...
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
- Net Salary Calculator (Toy Problem)Write a program whose major task is to calculate an individual’s Net Salary by getting the inputs of basic salary and benefits. Calculate the payee (i.e. Tax), NHIFDeductions, NSSFDeductions, gross salary, and net salary.arrow_forwardChapter 5B Exercise 1 - Extra Exercise - Holy Digits Holy digits Batman! The Riddler is planning his next caper somewhere on Pennsylvania Avenue. In his usual sporting fashion, he has left the address in the form of a puzzle. The address on Pennsylvania is a four-digit number where: All four digits are different The digit in the thousands place is three times the digit in the tens place The number is odd The sum of the digits is 27 Write a program that uses a loop (or loops) to find the address where the Riddler plans to strike.arrow_forwardProblem3: Looping: (30 points)Create a program flowchart that generates and displays the Fibonacci sequencenumbers of n(as input). In Fibonacci, the current third number is the sum of two previousnumbers. Sample input/output dialogue:Enter a no. 9Fibonacci series : 1 1 2 3 5 8 13 21 34Your flowchart and pseudocode here…...pls help me :(arrow_forward
- 1)use two list one for names and one for cost 2) keep total cost you will spend and print the average cost for a gift - ????? could you do this with just one list??? 3) after end of loop print the two list and the average and the number of name and number of cost in the list. (suggestion - use for loop) USE this Program: Holiday = []name = input("enter name").upper()while name != "XXX":cost = float(input("enter amount to spend >0 and <=10"))while cost <=0 or cost >10:print("invalid cost")cost = float(input("enter amount to spend >0 and <=10"))gift = name + " " + str(cost)Holiday.append(name)Holiday.append(cost)Holiday.append(gift)name = input("enter name").upper()print(Holiday)arrow_forwardPythonarrow_forwardComputer-Assisted Instruction) The use of computers in education is referred to as computer- assisted instruction (CAI). Write a program that will help an elementary school student learn multiplication. Use the rand function to produce two positive one-digit integers. The program should then prompt the user with a question, such as How much is 6 times 7? The student then inputs the answer. Next, the program checks the student’s answer. If it’s correct, display the message "Very good!" and ask another multiplication question. If the answer is wrong, display the message "No. Please try again." and let the student try the same question repeatedly until the student finally gets it right. A separate function should be used to generate each new question. This function should be called once when the application begins execution and each time the user answers the question correctly.arrow_forward
- C Programming Write function checkHorizontal to count how many discs of the opposing player would be flipped, it should do the following a. Return type integer b. Parameter list i. int rowii. int col iii. char board[ROW][COL] iv. char playerCharc. If the square to the left or right is a space, stop checking d. If the square to the left or right is the same character as the player’s character, save that it was a flank, stop checking e. If the square to the left or right is not the same character as the player’s character, count the disc f. If the counted discs is greater than zero AND the player found their own character, return the counted discs, otherwise return ZERO Write function checkVertical to count how many discs of the opposing player would be flipped, it should do the following a. Return type integer b. Parameter list i. int rowii. int col iii. char board[ROW][COL] iv. char playerCharc. If the square above or below is a space, stop checking d. If the square above or below is…arrow_forwardQ1) An accountant works for a company and there is a need for a C program to calculate the average income of fifteen employees after cutting tax from it. Write a program that takes the gross income of the 15 employees using scanf and check the tax range using the given table below. Use repetition structure (while or for loop) to calculate the salary of each entployee and if/else statements to select the salary based on the gross income. Besides, find the sum of all the salaries and print the average salary for fifteen employees. The formulation for calculating the salary is shown below: Salary = Gross Income Salary = GrossIncome - GrossIncome 0.05 Salary = GrossIncome – Grosslncome • 0.10 Salary = GrossIncome – Grosslncome 0.15 GrossIncome < 500$ 500$ < GrossIncome < 700$ 700$ < GrossIncome < 1000$ 1000$ < GrossIncome Salary =arrow_forwardLO: (Remember) Students will recall how to read from standard input. LO: (Apply) Students will write loops that iterate as long as a condition is true. Write a program that reads words from standard input and displays them to standard output. When the word "end" is read, print it out and then stop reading input. Full Screen * maln.cpp New #include 2 using namespace std; 1 3 4- /* 5 * Reads and displays words from standard input until hitting a stop word. 6 */ 7- int main() { 8 9. 10 return 0; 11 annarrow_forward
- (Conversion) a. Write a C++ program to convert meters to feet. The program should request the starting meter value, the number of conversions to be made, and the increment between metric values. The display should have appropriate headings and list the meters and the corresponding feet value. If the number of iterations is greater than 10, have your program substitute a default increment of 10. Use the relationship that 1 meter = 3.281 feet. b. Run the program written in Exercise 6a on a computer. Verify that your program begins at the correct starting meter value and contains the exact number of conversions specified in your input data. c. Modify the program written in Exercise 6a to request the starting meter value, the ending meter value, and the increment. Instead of the condition checking for a fixed count, the condition checks for the ending meter value. If the number of iterations is greater than 20, have your program substitute a default increment of (ending value - starting value) / 19.arrow_forwardRedo Programming Exercise 8 using dowhile loops.arrow_forward# Question 3# replace these for-loops with while loops# don't change any more than is necessary for salute in ["hello","hi","greetings","hey!","<nod>"]: for person in ["Jane","Charles","Fitz"]: print (salute,person) Subject: Python Programmingarrow_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
Boolean Algebra - Digital Logic and Logic Families - Industrial Electronics; Author: Ekeeda;https://www.youtube.com/watch?v=u7XnJos-_Hs;License: Standard YouTube License, CC-BY
Boolean Algebra 1 – The Laws of Boolean Algebra; Author: Computer Science;https://www.youtube.com/watch?v=EPJf4owqwdA;License: Standard Youtube License