Write a function showThem that receives two parameters: a char parameter ch and a float parameter f. The function displays these values. Call the function from main using last two digits of your enrollment as literals.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
A03--Functions--28122020-1225 X
YouTube
+
O X
O File | C:/Users/Ali%20Akbar/Downloads/A03--Functions--28122020-122516pm%20(1).pdf
Paused
A03--Functions--28122020-122516pm (1).pdf
1 / 1
Q #1
Write a function showThem that receives two parameters: a char parameter ch and a float
parameter f. The function displays these values. Call the function from main using last two digits
of your enrollment as literals.
Q # 2
Write a function arrangeThem that receives two reference parameters of type int and
arranges them in ascending order (minimum of two values is stored in the first parameter and
maximum of them in the second parameter). Declare and input four int variables in main; and
call arrangeThem (as many times as needed) from main using these variables; then display all
four values in ascending order in main.
Q# 3
Write a function getHCF that receives two parameters of type int and returns their Highest
Common Factor (or Greatest Common Divisor). You may use arrangeThem (mentioned above
in Q # 2) in this function, if needed. Declare and input two int variables in main; and call getHCF
function from main using these variables.
Q # 4
Write a function Compute that receives four or five parameters of type int. The first parameter
is used to store the sum and second parameter is used to store the product; the remaining
parameters (third/forth or third/fourth/fifth) are used as operands. Call this function twice from
main to demonstrate with suitable messages (before and after function calls). You may choose
Overloading or Default Argument for this task; write a convincing reason of your choice.
SUBMISSION REQUIREMENT
You are required to write programs on computer. Write Question No., your Name & Roll No. in
the comment on first line of each program. Submit the code of those programs (having line
numbers) in a doc/pdf file. Use suitable part of your roll number as inputs/literals/values for
Execution Sheet of each question.
12:19 PM
Ps
12/30/2020
(1
...
Transcribed Image Text:A03--Functions--28122020-1225 X YouTube + O X O File | C:/Users/Ali%20Akbar/Downloads/A03--Functions--28122020-122516pm%20(1).pdf Paused A03--Functions--28122020-122516pm (1).pdf 1 / 1 Q #1 Write a function showThem that receives two parameters: a char parameter ch and a float parameter f. The function displays these values. Call the function from main using last two digits of your enrollment as literals. Q # 2 Write a function arrangeThem that receives two reference parameters of type int and arranges them in ascending order (minimum of two values is stored in the first parameter and maximum of them in the second parameter). Declare and input four int variables in main; and call arrangeThem (as many times as needed) from main using these variables; then display all four values in ascending order in main. Q# 3 Write a function getHCF that receives two parameters of type int and returns their Highest Common Factor (or Greatest Common Divisor). You may use arrangeThem (mentioned above in Q # 2) in this function, if needed. Declare and input two int variables in main; and call getHCF function from main using these variables. Q # 4 Write a function Compute that receives four or five parameters of type int. The first parameter is used to store the sum and second parameter is used to store the product; the remaining parameters (third/forth or third/fourth/fifth) are used as operands. Call this function twice from main to demonstrate with suitable messages (before and after function calls). You may choose Overloading or Default Argument for this task; write a convincing reason of your choice. SUBMISSION REQUIREMENT You are required to write programs on computer. Write Question No., your Name & Roll No. in the comment on first line of each program. Submit the code of those programs (having line numbers) in a doc/pdf file. Use suitable part of your roll number as inputs/literals/values for Execution Sheet of each question. 12:19 PM Ps 12/30/2020 (1 ...
Expert Solution
Step 1

Note: We are authorized to answer one question at a time, since you have not mentioned which question you are looking for, so we are answering the first one, please repost your question separately for the remaining question.

Note: In this question, the coding language is not specified then we are doing this question in the CPP language.

Note: In this question, the Registration number is required, but the registration number is not given in the question then we are assuming the registration number.

 

CPP program:

 

//including essential header file

#include <iostream>

 

//using standard namespace

using namespace std;

 

//function to display value receives in Parameter

 int showThem( char ch, float f )

 {

     //display the character value

     cout << "Character value is: " << ch << endl;

    

     //display the floating value

     cout << "Floating value is: " << f << endl;

   

 }

 

 

//main function

int main()

{

    //call the function using the last two digit of the registration number as literal value

    //assuming registration number is 12345678

    //last two digit of the registration number is 78

    showThem( 78, 78 );

}

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Functions
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education