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.

A reliable hosting company which I highly recommend and use for Wordpress, Oxwall and Skadate hosting is currently giving out more than 50% discount, including VPS and shared hosting. This might be your last chance to host with a2hosting.

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!

Premium Service

If you seek a custom feature developed for your website or need 24/7 premium support to help you get started with your social network or Skadate dating website, save hours of searching online or wasting money on 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 in Touch

Leave a Reply