bsc

Comprehensive codebase and cou...
Log | Files | Refs | Activity | README | LICENSE

root / semester_2 / eduincs / pgrm_010.cpp

pgrm_010.cpp (501B)


      1 /* Default argument */
      2 
      3 #include<iostream>
      4 using namespace std;
      5 class Interest {
      6 public: 
      7     float simpleInterest(float p, float t = 5.0, float r = 1.0) {
      8         return (p * t * r) / 100;
      9     }
     10 };
     11 
     12 int main() {
     13     Interest obj;
     14     cout << "Principle only = " << obj.simpleInterest(10000) << endl;
     15     cout << "Principle and Time = " << obj.simpleInterest(10000, 8.0f) << endl;
     16     cout << "Principle, Time and Rate of Interest = " << obj.simpleInterest(10000, 8.0f, 5.0f) << endl;
     17     return 0;
     18 }
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror