MYPROGRAMMINGLAB WITH PEARSON ETEXT
8th Edition
ISBN: 9780134225340
Author: Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 9, Problem 9.13E
(Reading an Integer with Each scanf Conversion Specifier) Write a
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
(Inputting Decimal, Octal and Hexadecimal Values) Write a program to test the inputtingof integer values in decimal, octal and hexadecimal formats. Output each integer read by the program in all three formats. Test the program with the following input data: 10, 010, 0x10.
(Count positive and negative numbers and compute the average of numbers) Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the maximum, minimum, and average as a floating-point number. Here is a sample run:Enter an integer, the input ends if it is 0: 1 2 -1 3 0The number of positives is 3The number of negatives is 1The maximum is 3.0The minimum is -1.0The average is 1.25
(Sum the digits in an integer) Write a program that reads an integer between 0 and 1000 and adds all the digits in the integer. For example, if an integer is 932, the sum of all its digits is 14.
Chapter 9 Solutions
MYPROGRAMMINGLAB WITH PEARSON ETEXT
Ch. 9 - Write a printf or scanf statement for each of the...Ch. 9 - (Differences Between %d and %i) Write a program to...Ch. 9 - (Printing Numbers in Various Field Widths) Write a...Ch. 9 - (Rounding Floating-Point Numbers) Write a program...Ch. 9 - (Temperature Conversions) Write a program that...Ch. 9 - (Escape Sequences) Write a program to test the...Ch. 9 - (Printing a Question Mark) Write a program that...Ch. 9 - (Reading an Integer with Each scanf Conversion...Ch. 9 - (Outputting a Number with the Floating-Point...Ch. 9 - (Reading Strings in Quotes) In some programming...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Code an SQL statement that creates a table with all columns from the parent and child tables in your answer to ...
Database Concepts (7th Edition)
Find the error in each of the following code segments: 1. catch (FileNotFoundException e) { System.out.println(...
Starting Out with Java: From Control Structures through Objects (6th Edition)
Repair Bill Suppose automobile repair customers are billed at the rate of per hour for labor. Also, suppose co...
Introduction To Programming Using Visual Basic (11th Edition)
In what ways are abstract data types and classes similar? In what ways are they different?
Computer Science: An Overview (12th Edition)
Describe the three types of anomalies that can arise in a table and the negative consequences of each.
Modern Database Management (12th Edition)
Circumference and Area of a Circle) Heres a peek ahead. In this chapter, you learned about integers and the typ...
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
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
- (Financials: currency exchange) Write a program that prompts the user to enter the exchange rate from currency in U.S. dollars to Rupees PKR. Prompt the user to enter 0 to convert from U.S. dollars to Rupees PKR and 1 to convert from Rupees PKR and U.S. dollars. Prompt the user to enter the amount in U.S. dollars or Rupees PKR to convert it to Rupees PKR or U.S. dollars, respectively. Use c++ program.arrow_forward(Phone key pads) The international standard letter/number mapping found on the telephone is shown below: 100 2 abc 3 def 4 ghi 5 ikl 6mno 7pgrs 8 tuv 9wxyz Write a program that prompts the user to enter a letter and displays its correspond- ing number.arrow_forward(Converting a given date to the day number in the year) Write a program that prints the day number of the year, given the date is in the form month day year. For example, if the input is 1 1 05, the day number is 1; if the input is 12 25 05, the day number is 359. The program should check for a leap year. A year is a leap year if it is divisible by 4 but not divisible by 100. For example, 1992 and 2008 are divisible by 4, but not by 100. A year that is divisible by 100 is a leap year if it is also divisible by 400. For example, 1600 and 2000 are divisible by 400. However, 1800 is not a leap year because 1800 is not divisible by 400. Directions: Call 3 functions from your main. One to input data (pass parameters in a list) One to determine the result (use a value returning function to determine and return the result) One to display both the date and the result You can use two Python dictionaries to represent the number of days in each month for a regular and a leap year. Ex.…arrow_forward
- (Geometry: area of a hexagon) The area of a hexagon can be computed using the following formula (s is the length of a side): 6 x s? Area TT 4 X tan 6. Write a program that prompts the user to enter the side of a hexagon and displays its area. Here is a sample run:arrow_forward(Display a pattern) Write a program that displays the following pattern:JJ aaa v vaaaJ J aa v v a aJ aaaa v aaaaarrow_forward(PYTHON) A Krishnamurthy number is a number which sum of the factorial of its digits is equal to the number itself. For example: Let us consider the number 145. Factorial sum = 1! + 4! + 5! = 1 + 24 + 120 = 145. Therefore 145 is a Krishnamurthy number. Other examples include: 1, 2, 40585. Write a program that does the following: • asks the user to input an integer. • computes whether the number is a Krishnamurthy number. • then finally prints the result. Note: You are not allowed to use the built-in function math.factorial.arrow_forward
- (Count the letters in a string) Write a function that counts the number of letters in a string using the following header: def countLetters(s) : Write a test program that prompts the user to enter a string and displays the number of letters in the string. the answer should be in python.arrow_forward2. Find the error in each of the following. (Note: There may be more than one error.) a. The following code should print whether a given integer is odd or even: switch (value % 2) case 0: puts ("Even integer"); case 1: puts ("Odd integer"); b. The following code should output the even integers from 2 to 100: counter = 2; Do { if (counter % 2 == printf("%u%n", counter); 0) { I counter += 2; } While (counter < 100);arrow_forward(Find the second lowest interger number) Write a program that prompts the user to enter a set of integer numbers, and finally displays the second lowest integer number in the set. To exit from the program enter -1.arrow_forward
- (Sum the digits in an integer) Programming Exercise 2.6 prompts the user to enter an integer between 0 and 1000, and displays the sum of all digits in the integer. Write a program that prompts the user to enter a three-digit integer. The program displays the sum of all digits in the integer if the input is valid; otherwise, it displays a message indicating that the integer is not a three-digit number and hence, is invalid. Use C++ program.arrow_forward(Display patterns using loops) Use nested loops that display the following patterns in two separateprograms: pattern A Pattern B Pattern c 123456 1 3 1 6 1 2 3 3 3 1 6 1 2 3 4 5 3 3 3 1 6 1 2 3 4 5 6 7 3 3 1 6 1 2 3 4 5 6 7 8 9 3 123456arrow_forward(Using Visual Basic language) Marketing Terms? The markup of an item is the difference between its selling price and its purchase price. Two other marketing terms are percentage markup=makeup/(purchase price) and profit margin= makeup/(selling price) where the quotients are expressed as percentages. Write a program that computes the markup, percentage markup, and profit margin of an item. Note: The output format of your program should be exactly the same as given below One possible outcome: Enter purchase price: 215 Enter selling price: 645 Markup: $430.0 Percentage markup: 200.0% Profit margin: 66.67%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
What Are Data Types?; Author: Jabrils;https://www.youtube.com/watch?v=A37-3lflh8I;License: Standard YouTube License, CC-BY
Data Types; Author: CS50;https://www.youtube.com/watch?v=Fc9htmvVZ9U;License: Standard Youtube License