• <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.

            久久人人爽人人爽人人爽| 免费国产99久久久香蕉| 亚洲中文字幕伊人久久无码| 久久国产视屏| 国产色综合久久无码有码| avtt天堂网久久精品| 久久99精品久久久久久9蜜桃| 久久人人爽人人爽人人片AV麻豆| 18禁黄久久久AAA片| 久久精品国产亚洲欧美| 性欧美大战久久久久久久| 9久久9久久精品| 久久精品无码一区二区WWW| 国产精品久久久久久久久免费| 一本一道久久a久久精品综合| 2022年国产精品久久久久| 久久频这里精品99香蕉久| 久久久久久久综合日本亚洲| 久久精品中文字幕一区| 国内精品伊人久久久久影院对白| 亚洲国产精品一区二区久久hs| 久久久久亚洲精品天堂久久久久久 | 久久婷婷色综合一区二区| 青青草国产成人久久91网| 国产午夜免费高清久久影院| 一级A毛片免费观看久久精品| 曰曰摸天天摸人人看久久久| 久久精品国产亚洲av高清漫画| 2021国内久久精品| 久久99热这里只频精品6| 日韩影院久久| 一本色道久久88综合日韩精品 | 2021最新久久久视精品爱| 久久嫩草影院免费看夜色| 国产亚洲色婷婷久久99精品91| 精品久久久久久久久中文字幕| 久久人人爽人人爽人人片AV不| 欧美黑人激情性久久| 无码超乳爆乳中文字幕久久| 久久亚洲中文字幕精品有坂深雪| 国色天香久久久久久久小说|