C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
Question
Book Icon
Chapter 6.2, Problem 12E

(a)

Program Plan Intro

Program plan:

  1. DeclarevariablesintNumberof type int.

Program description:

The main purpose of the function is to accepts argument number and return integer part of the number.

(b)

Program Plan Intro

Program plan:

2. Declaredvariablestest1and test2to test the function.

3. cout statement is used to print statement.

Program description:

To include the function written for (a) in a working program.

Blurred answer
Students have asked these similar questions
(C PROGRAMMING ONLY) 4. Special Exchanging Giftsby CodeChum Admin It's Christmas time and we're having this exchanging gifts activity! I want to surprise the receiver of my gift. After he/she receives my gift, I will add an additional P100 bill! Instructions: In the code editor, you are provided with a main() function that asks the user for 2 integers. Then, a function call to a function named, exchangeGift() is made and the addresses of the 2 integers are passed.This exchangeGift() function hasn't been implemented yet so this is your task. This has the following description:Return type - voidName - exchangeGiftParameters - 2 addresses of 2 integersDescription - swaps the value of the 2 integers and then adds 100 to the 2nd integer (or 2nd parameter)DO NOT EDIT THE MAINInput 1. First integer 2. Second integer Output Enter·integer·1:·10Enter·integer·2:·2020·110
(C PROGRAMMING ONLY) DO NOT EDIT THE MAIN 7. Special Exchanging Giftsby CodeChum Admin It's Christmas time and we're having this exchanging gifts activity!   I want to surprise the receiver of my gift. After he/she receives my gift, I will add an additional P100 bill!   Instructions: In the code editor, you are provided with a main() function that asks the user for 2 integers. Then, a function call to a function named, exchangeGift() is made and the addresses of the 2 integers are passed.This exchangeGift() function hasn't been implemented yet so this is your task. This has the following description:Return type - voidName - exchangeGiftParameters - 2 addresses of 2 integersDescription - swaps the value of the 2 integers and then adds 100 to the 2nd integer (or 2nd parameter)DO NOT EDIT THE MAINInput 1. First integer 2. Second integer Output Enter integer 1: 10Enter integer 2: 2020 110
(C PROGRAMMING ONLY) 7. Comparing Charactersby CodeChum Admin Most, if not all things have numeric values. That goes for characters too. In order to find out which character has a higher value, we have to compare them with each other and display the value of the higher character.   Instructions: In the code editor, you are provided with a main() function that asks the user for 2 characters, passes these characters to a function call of the getHigherValue() function, and then prints out the ASCII value of the higher character.Your task is to implement the getHigherValue function which has the following details:Return type - intName - getHigherValueParameters - 2 characters to be comparedDescription - the ASCII value of the higher character.Hint: Comparing characters in C is just like comparing integers.DO NOT EDIT ANYTHING IN THE MAINInput 1. First character 2. Second character Output Enter first character: aEnter second character: hResult value = 104
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education