• <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++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            The credit card codes

            Posted on 2011-09-23 01:13 hoshelly 閱讀(296) 評論(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超级碰碰碰碰久久久久| 国产精品久久久久一区二区三区| 国产成人精品久久亚洲| 色欲久久久天天天综合网精品| 久久久久久毛片免费看| 精品综合久久久久久97| 久久精品国产福利国产秒| 一本色综合久久| 国产福利电影一区二区三区,免费久久久久久久精 | 久久天天躁狠狠躁夜夜avapp| 精品伊人久久久| 国产亚洲精品美女久久久| 久久久久18| 久久综合给合久久国产免费| 久久亚洲精品无码观看不卡| 久久久久久无码Av成人影院| 欧美性大战久久久久久| 69久久夜色精品国产69| 麻豆精品久久久久久久99蜜桃| 成人综合伊人五月婷久久| 99久久精品免费观看国产| 久久人人爽人人人人爽AV| 精品无码人妻久久久久久| 91久久精品91久久性色| 久久午夜伦鲁片免费无码| 久久久久久久波多野结衣高潮| 久久久久久噜噜精品免费直播| 久久亚洲精品中文字幕| 久久这里的只有是精品23| 欧美色综合久久久久久| 久久精品国产亚洲精品| 国产精品日韩欧美久久综合| 成人久久综合网| 91精品国产高清久久久久久io | 一极黄色视频久久网站| 久久精品国产第一区二区| 精品无码久久久久久久久久| 亚洲&#228;v永久无码精品天堂久久| 精品久久久久中文字幕日本|