1. For the following function headers, determine the number, type, and order(sequence) of the values that must be passed to the function: a. void factorial(int n) b. void power(int type, double induct, double cap) c. void flag(char type, double current, double time) d. void tot

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%


1. For the following function headers, determine the number, type, and order(sequence) of the values
that must be passed to the function:
a. void factorial(int n)
b. void power(int type, double induct, double cap)
c. void flag(char type, double current, double time)
d. void total(double amount, double rate)
e. void getVal(int item, int iter, char decflag, char delim)
2. Write function headers for the following:
a. A function named check() that has three parameters. The first parameter should accept an
integer number, and the second and third parameters should accept a double-precision number.
The function returns no value.
b. A function named findAbs() that accepts a double-precision number passed to it and returns
its absolute value.
c. A function named mult() that accepts two floating-point numbers as parameters, multiplies
these two numbers, and returns the result.
d. A function that produces a table of the numbers from 1 to 10, their squares, and their cubes. No
arguments are to be passed to the function, and the function returns no value.
e. Write a function named rightTriangle() that accepts the lengths of two sides of a right
triangle as the arguments a and b. The function should determine and return the hypotenuse, c,
of the triangle. (Hint: Use Pythagoras’ theorem,

 

)
3. Write a function named check() that has three parameters. The first parameter should accept an
integer number, and the second and third parameters should accept a double precision number. The
function body should just display the values of data passed to the function when it’s called.
(Note: When tracing errors in functions, having the function display values it has been passed is
helpful. Quite often, the error isn’t in what the function body does with data, but in the data received
and stored.)
4. Write a function named findAbs() that accepts a double-precision number passed to it, computes
its absolute value, and displays the absolute value.
A number’s absolute value is the number itself, if the number is positive and the negative of the
number, if the number is negative.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Concept of Parenthesis
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