1. Identify the format of the function used: no return type & no parameter, with return type & no parameter, no return type & with parameter and with return type & with parameter.

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

PROGRAMMING LANGUAGE: C++

Note: Kindly refer to the attached screenshot for the sample program.

1. Identify the format of the function used: no return type & no parameter, with return type & no parameter, no return type & with parameter and with return type & with parameter.

2. Identify the format and actual parameters.

3. Identify the function signature

4. Identify parameter if value parameter, reference parameter or constant reference parameter is used.

5. Identify the the scope of variable used.

6. Identify the type of C++ function is used.

main.cpp
+
1 #include <iostream>
2 #include <iomanip>
3
4 using namespace std;
5
6 const double GALLONS_IN_A_CUBIC_FOOT = 7.48;
8 double poolCapacity(double len, double wid, double dep);
9 void poolFillTime(double len, double wid, double dep,
10
11 void print(int fTime);
double fRate, int& fTime);
12
13 int main(().
14 {
15
double length, width, depth;
double fillRate;
int fillTime;
16
17
18
19
cout <« fixed <« showpoint « setprecision(2);
20
21
cout <« "Enter the length, width, and the depth of the "
« "pool, (in feet): ";
cin >> length >> width >> depth;
22
23
24
cout <« endl;
25
cout <« "Enter the rate of the water, (in gallons per minute): ";
cin >> fillRate;
26
27
28
cout <« endl;
29
poolFillTime(length, width, depth, fillRate, fillTime);
print(fillTime);
30
31
32
33
return 0;
34 }
Transcribed Image Text:main.cpp + 1 #include <iostream> 2 #include <iomanip> 3 4 using namespace std; 5 6 const double GALLONS_IN_A_CUBIC_FOOT = 7.48; 8 double poolCapacity(double len, double wid, double dep); 9 void poolFillTime(double len, double wid, double dep, 10 11 void print(int fTime); double fRate, int& fTime); 12 13 int main((). 14 { 15 double length, width, depth; double fillRate; int fillTime; 16 17 18 19 cout <« fixed <« showpoint « setprecision(2); 20 21 cout <« "Enter the length, width, and the depth of the " « "pool, (in feet): "; cin >> length >> width >> depth; 22 23 24 cout <« endl; 25 cout <« "Enter the rate of the water, (in gallons per minute): "; cin >> fillRate; 26 27 28 cout <« endl; 29 poolFillTime(length, width, depth, fillRate, fillTime); print(fillTime); 30 31 32 33 return 0; 34 }
35
36 double poolCapacity(double len, double wid, double dep)
37 {
38
double volume;
39
double poolWaterCapacity;
40
41
volume = len * wid * dep;
42
poolWaterCapacity = volume * GALLONS_IN_A_CUBIC_FOOT;
43
44
return poolWaterCapacity;
45 }
46
47 void poolFillTime(double len, double wid, double dep,
48
double fRate, int& fTime)
49 {
50
double poolWaterCapacity;
51
poolWaterCapacity = poolCapacity(len, wid, dep);
fTime = static_cast<int> (poolWaterCapacity / fRate + 0.5);
52
53
54 }
55
56 void print(int ƒTime)
57 {
58
cout <« "The time to fill the pool is approximately:
<« fTime / 60 <« " hour(s) and " <« fTime % 60
<« " minute(s)." <« endl;
59
60
II
61 }
62
Transcribed Image Text:35 36 double poolCapacity(double len, double wid, double dep) 37 { 38 double volume; 39 double poolWaterCapacity; 40 41 volume = len * wid * dep; 42 poolWaterCapacity = volume * GALLONS_IN_A_CUBIC_FOOT; 43 44 return poolWaterCapacity; 45 } 46 47 void poolFillTime(double len, double wid, double dep, 48 double fRate, int& fTime) 49 { 50 double poolWaterCapacity; 51 poolWaterCapacity = poolCapacity(len, wid, dep); fTime = static_cast<int> (poolWaterCapacity / fRate + 0.5); 52 53 54 } 55 56 void print(int ƒTime) 57 { 58 cout <« "The time to fill the pool is approximately: <« fTime / 60 <« " hour(s) and " <« fTime % 60 <« " minute(s)." <« endl; 59 60 II 61 } 62
Expert Solution
steps

Step by step

Solved in 2 steps with 7 images

Blurred answer
Knowledge Booster
Function Arguments
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
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