• <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 閱讀(288) 評論(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.

            亚洲午夜福利精品久久| 久久久久一区二区三区| 久久AV高潮AV无码AV| 人妻无码αv中文字幕久久琪琪布| 久久人人爽人人爽人人AV东京热| 亚洲成人精品久久| 综合人妻久久一区二区精品| 97久久超碰国产精品旧版| 欧美大战日韩91综合一区婷婷久久青草| 国产色综合久久无码有码| 超级碰久久免费公开视频| 日韩乱码人妻无码中文字幕久久| 久久久久噜噜噜亚洲熟女综合| 久久天堂AV综合合色蜜桃网| 青春久久| 久久久久九国产精品| 久久综合久久久| 久久99国产精品久久久| 97视频久久久| 伊人久久无码精品中文字幕| 国产韩国精品一区二区三区久久 | 久久九九精品99国产精品| 久久se精品一区精品二区国产| 婷婷久久香蕉五月综合加勒比| 亚洲国产成人乱码精品女人久久久不卡| A狠狠久久蜜臀婷色中文网| 色偷偷88888欧美精品久久久| 亚洲国产成人久久综合碰| 人妻少妇精品久久| 久久99精品国产麻豆蜜芽| 久久精品国产WWW456C0M| 精品水蜜桃久久久久久久| 久久精品国产99久久丝袜| 久久精品综合一区二区三区| 国产成人久久久精品二区三区| 777久久精品一区二区三区无码| 97超级碰碰碰碰久久久久| 久久精品三级视频| 久久天天躁狠狠躁夜夜2020 | 97久久精品人人做人人爽| 国产精品久久久久无码av|