Question: Write a user-defined function that fulfill the following requirements: Take a double number and return the ceiling of the number. [Ceiling of x is the

  1. Write a user-defined function that fulfill the following requirements:

Take a double number and return the ceiling of the number. [Ceiling of x is the smallest integer greater than or equal to x.]

(You can NOT use any pre-defined function such as 'ceil()' in your function.)

  1. Please use your own words to describe what is a computer programming variable and use the following example to illustrate your point.

int age;

  1. Please create a user-defined function that searches for a string in a string array.

The function takes three parameters: string array, int arraySize, and string word

The function will loop through the string array. If word is found in the array, return the matched elements position (index) in the array. Otherwise, return -1.

When a match is found in the array, the loop should be terminated at the time --- no need to continue the loop.

If no match is found, the function should display all elements in the array, as well as the search word.

Please make sure the function cannot modify any data in the array.

  1. Please create a user-defined function that captures a users bank accounts initial balance and ensuing transactions.

The function should do the following:

Take two parameters: amount the customer withdraws, and the amount the customer deposits.

Set the initial balance of bank account.

Add the deposit amount to the current balance.

Deduct the withdrawal amount to the current balance.

Return the updated current balance (Note: Each time when function is called, the current balance should be the updates from the previous balance.)

If the withdrawal amount is greater than the current balance, displays some warning message and displays the available balance.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!