Explore BrainMass

Solve for Reusable Code

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

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.

© BrainMass Inc. brainmass.com December 19, 2018, 11:45 pm ad1c9bdddf

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 invoice.zip file is also provided with this solution.