/** Copyright (c) 2011, School of Computer Science, Yantai University * All Rights Reserved. * file name: test. CPP * Author: Fan Lulu * Completion Date: July 15, October 25, 2012 * version No.: V1.0 ** input Description: none * Problem description: Enter the deposit amount and select the deposit type, calculate Interest * program output: interest and Interest * Problem Analysis: slightly * Algorithm Design: slightly */# include <iostream> using namespace STD; int main () {double lx, je, CQ, BX; int t; cout <"==== deposit term ====" <Endl; cout <"1. demand deposits "<Endl; cout <" 2. 3 months "<Endl; cout <" 3. 6 months "<Endl; cout <" 4. one year "<Endl; cout <" 5. two years "<Endl; Cout <"6. three years "<Endl; cout <" 7. five Years "<Endl; cout <" Enter the deposit code (1-7): "; CIN> T; If (T> = 8) cout <"Incorrect deposit type selection! Please reselect. "; else {cout <" Enter the deposit amount (RMB): "; CIN> je; If (t = 1) {cout <"Enter the deposit period CQ (days):"; CIN> CQ;} switch (t) {Case 1: lx = je * 0.005 * CQ/360; BX = je + lx; break; Case 2: Lx = je * 0.031*3/12; BX = je + lx; break; Case 3: lx = je * 0.033*6/12; BX = je + lx; break; Case 4: Lx = je * 0.035*1; BX = je + lx; break; Case 5: lx = je * 0.044*2; BX = je + lx; break; Case 6: Lx = je * 0.050*3; BX = je + lx; break; Case 7: lx = je * 0.055*5; BX = je + lx; break;} cout <"Expiration interest:" <lx <"RMB, total principal and interest: "<BX <" Yuan. "<Endl; cout <" Thank you for your use. Welcome to the next time. ";} Return 0 ;}
Experience: there are indeed many obstacles to doing this, but they have been solved. Haha.