Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 2 Lnai 6322

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215882X, 978-3642158827

More Books

Students also viewed these Databases questions

Question

Conduct a needs assessment. page 269

Answered: 1 week ago