Term Deposit Interest Calculator version-c++

Source: Internet
Author: User

Post-processing becomes a useful function, which is recorded here as a demo.


#include <iostream> using namespace Std;int main () {int type;double money, period, rate, Interest;cout << "Welcome to make Use the interest calculator! "<< endl;cout <<" Please enter Deposit Amount: "Cin >> money;cout <<" ====== deposit term ====== "<< endl;cout <<" 1.3 months "<< endl;cout <<" 2. 6 months "<< endl;cout <<" 3. One year "<< endl;cout <<" 4. Two years "<< endl;cout <<" 5. Three years "<< endl;cout <<" 6.   Five years "<< endl;cout <<" Please enter the term of deposit: "; Cin >> type;if (type >= 1 && type <= 6) {switch (type) In if the switch is embedded in the case of the 1:period = 0.25;rate = 0.031;break;case 2:period = 0.5;rate = 0.033;break;case 3:period = 1;ra Te = 0.035;break;case 4:period = 2;rate = 0.044;break;case 5:period = 3;rate = 0.05;break;case 6:period = 5;rate = 0.055;b Reak;} Interest = money * Period * rate;cout << "interest due:" << interest << "Yuan, principal sum total" << interest + money &lt ;< "Yuan. "<< Endl;} Elsecout << "Choose the Deposit type Error! "<< EndL;cout << "Thank you for your use, welcome to the next visit!" "<< Endl;system (" pause "); return 0;}


Term Deposit Interest Calculator version-c++

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.