Simple Paypal Fee Calculator with C++

Last updated on May 5th, 2018 at 02:48 pm

Here is a simple C++ program that will output how much you get when you charge certain amount on Paypal and how much you should charge to get a particular amount.

Program Details

This program was written with Code Block IDE/compiler. Paypal charges 2.2% + $0.30 of every payment you receive.

/* Project: PayPal Fee calculator Developer: Ebenezer Obasi Website: */ #include <iostream> #include<iomanip> using namespace std; float rate( float r){ r = 0.029 * r + 0.30; // 2.9% * Your Amount + Additional $0.30 return r; } int main() { float amount, paypal, am, charg, charge, charger; cout << “Enter amount: $”; cin >> amount; am = amount – rate(amount); paypal = rate(am); charg = am + paypal + 0.30; charge = charg – rate(charg); charger = amount + rate(charg); cout << fixed << setprecision(2) << “You will get: $” << am <<endl; cout << fixed << setprecision(2) << “PayPal takes: $” << paypal <<endl; cout << “——————————————–” <<endl; cout << fixed << setprecision(2) << “If you charge: $” << charg <<endl; cout << fixed << setprecision(2) << “You will get: $” << charge <<endl; cout << fixed << setprecision(2) << “Paypal takes: $” << rate(charg) <<endl; cout << “——————————————–” <<endl; cout << fixed << setprecision(2) << “You should charge: $” << charger <<endl; cout << fixed << setprecision(2) << “Paypal takes: $” << rate(charg) <<endl; return 0; }

To get this running on your visual studio, simply include the following line in your pre-processor directive:

#include “stdafx.h”

Have fun!

Did you get the answer you were searching for?

Save hours of searching online or wasting money testing unnecessary plugins, get in touch with me and let's discuss a suitable plan for your project. Best thing about this service is that you are never placed on hold and get to talk to an expereinced Oxwall/Skadate developer.

Get Answers for Free!

Ask a question related to this topic and get immediate answers from other community members in 48hrs or less. Contribute by answering members questions.

Ask Question
Premium Service

Whether it's a custom plugin, theme or dedicated support needed to get you started on your project, get professional 24/7 support tailored to your need.

Get in Touch

Or just leave a comment...

Leave a Reply