Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question
100%

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 //***
**
2 // Author: D.S. Malik
3 //
4 |/ This program find the largest number of a set of 10
5 // numbers.
6 //*******
8 #include <iostream>
10 using namespace std;
11
12 double larger(double x, double y);
13
14 int main()
15
16
double num; //variable to hold the current number
17
double max; //variable to hold the larger number
int count; //loop control variable
18
19
20
cout <« "Enter 10 numbers." << endl;
cin >> num;
//Step 1
//Step 1
21
22
max = num;
23
for (count = 1; count < 10; count++)
{
cin >> num;
max = larger(max, num);
}
24
//Step 2
25
//Step 2a
//Step 2b
26
27
28
29
cout <« "The largest number is
<« endl;
30
<« max
31
//Step 3
32
33
return 0;
34 //end main
35
36 double larger(double x, double y)
37 {
38
if (x >= y)
39
return x;
40
else
41
return y;
42 }
43
expand button
Transcribed Image Text:main.cpp 1 //*** ** 2 // Author: D.S. Malik 3 // 4 |/ This program find the largest number of a set of 10 5 // numbers. 6 //******* 8 #include <iostream> 10 using namespace std; 11 12 double larger(double x, double y); 13 14 int main() 15 16 double num; //variable to hold the current number 17 double max; //variable to hold the larger number int count; //loop control variable 18 19 20 cout <« "Enter 10 numbers." << endl; cin >> num; //Step 1 //Step 1 21 22 max = num; 23 for (count = 1; count < 10; count++) { cin >> num; max = larger(max, num); } 24 //Step 2 25 //Step 2a //Step 2b 26 27 28 29 cout <« "The largest number is <« endl; 30 <« max 31 //Step 3 32 33 return 0; 34 //end main 35 36 double larger(double x, double y) 37 { 38 if (x >= y) 39 return x; 40 else 41 return y; 42 } 43
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
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