Explore BrainMass

Solve for Reusable Code

Scenario: Different programming languages exist in various libraries and on the Internet and using some of these functions and procedures, this can allow you to use these methods rather than having to write out the code from scratch on your own. However, some code needs some modification to fit into your program. Nevertheless, imagine that you find 3 sets of code that you can reuse and have an implementation of the code.

Implement reusable code such as functions and sub-procedures. Use effective communication techniques.

Solution Preview

Here is a more specific task of this nature:

Program Name { //begin of program

Procedure TrackPayment {

if amount_received < billing_amount then
amount_owing = billing_amount - amount_received

if date_payment_received > thirty_days then
late_fee_amount = late_charge_rate * billing_amount

account_balance = account_balance + amount_owing + late_fee_amount


Procedure CalculateInvoice {

if client_type = regular then
billing_amount = regular_price
billing_amount = regular_price - (service_price * discount_rate)

billing_amount = billing_amount + account_balance

Procedure PrintInvoice {

print client_name
print client_mailing_address
print invoice_number ...

Solution Summary

This solution illustrates how reusable codes such as functions and sub-procedures can be utilized in replacement of having to compose your own code. An file is also provided with this solution.