• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            天之道

            享受編程的樂趣。
            posts - 118, comments - 7, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

            The credit card codes

            Posted on 2011-09-23 01:13 hoshelly 閱讀(295) 評論(0)  編輯 收藏 引用 所屬分類: C++


            Tonight I was studying the credit card codes, all of these was copied from my book,"C++ ——how to program".

            This are the program demand:
            1)Account number(an integer);
            2)Balance at the begining of the month;
            3)Total all items charged by this customer this month;
            4)Total of all items applied to this customer's account this month;
            5)Allowed credit limit.


            The program should input each of these facts, calculate the new balance(=begining balance+charges-credits) and determine if the new balance exceeds the customer credit limit.
            For those customers whose credit limit is exceeded, the program should display the customer's account number,credit limit,new balance and the message "Credit limit exceeded".

            #include<iostream>
            #include
            <iomanip>// formatting integers and the precision of floating point values
            using namespace std;

            int main()
            {
                
            int accountNumber;
                
            double balance,charges,credits,limit;

                cout
            <<"Enter account number(-1 to end):"
                    
            <<setiosflags(ios::fixed|ios::showpoint);// to convert data from fixed point number representation to floating point representation
                cin>>accountNumber;
                
            while(accountNumber!=-1)
                
            {
                    cout
            <<"Enter beginning balance:";
                    cin
            >>balance;
                    cout
            <<"Enter total charges: ";
                    cin
            >>charges;
                    cout
            <<"Enter total credits:";
                    cin
            >>credits;
                    cout
            <<"Enter credit limit:";
                    cin
            >>limit;
                    balance
            +=charges-credits;

                    
            if(balance>limit)
                        cout
            <<"Account:  "<<accountNumber
                            
            <<"\nCredit limit: "<<setprecision(2)<<limit //accurate to two decimal point
                            
            <<"\nBalance:    "<<setprecision(2)<<balance
                            
            <<"\nCredit Limit Exceeded.\n";
                    cout
            <<"\nEnter account number(-1 to end): ";
                    cin
            >>accountNumber;
                }


                cout
            <<endl;
                
            return 0;
            }


             

            input -1 and the program will be ended.

            香蕉久久夜色精品国产小说| 性做久久久久久久久老女人| 无码人妻久久一区二区三区蜜桃| 久久午夜电影网| 精品久久久噜噜噜久久久 | 久久婷婷五月综合97色| 亚洲七七久久精品中文国产| 久久久久久噜噜精品免费直播| 国产精品九九久久精品女同亚洲欧美日韩综合区 | 久久久久久亚洲精品无码| 999久久久免费国产精品播放| 久久久国产精品网站| 91精品国产91久久久久久青草| 一本久久a久久精品综合夜夜| 亚洲国产精品久久久久| 狠狠色综合网站久久久久久久| 国产精品久久久久乳精品爆| 国产亚州精品女人久久久久久 | 久久婷婷是五月综合色狠狠| 久久人人爽人人爽人人片AV东京热| 久久亚洲AV成人无码软件| 无码人妻久久一区二区三区免费| 久久国产乱子伦免费精品| 久久久综合九色合综国产| 久久精品国产精品亚洲下载| 18禁黄久久久AAA片| 日韩人妻无码一区二区三区久久 | 久久久精品国产Sm最大网站| 亚洲精品97久久中文字幕无码| 少妇内射兰兰久久| 国产成人精品久久| 久久精品成人欧美大片| 99久久婷婷国产一区二区| 亚洲午夜久久久久妓女影院| 成人a毛片久久免费播放| 香港aa三级久久三级老师2021国产三级精品三级在 | 亚洲精品无码久久久久sm| 91精品婷婷国产综合久久| 97久久国产露脸精品国产| 人人狠狠综合久久亚洲婷婷| 国产成人精品综合久久久久|