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.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 7PE
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage