• <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 閱讀(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.

            国色天香久久久久久久小说| a级成人毛片久久| 久久久免费观成人影院| 久久综合视频网| 欧美伊香蕉久久综合类网站| 久久九九免费高清视频| 午夜不卡久久精品无码免费| 亚洲天堂久久精品| 狠狠综合久久AV一区二区三区| AV狠狠色丁香婷婷综合久久| 午夜视频久久久久一区 | 久久综合噜噜激激的五月天| 国产精品久久久久影院嫩草| 久久天天躁夜夜躁狠狠躁2022| 97精品久久天干天天天按摩| 欧美成人免费观看久久| 国産精品久久久久久久| 日韩乱码人妻无码中文字幕久久| 久久se精品一区精品二区国产| 人妻丰满AV无码久久不卡| 亚洲伊人久久成综合人影院| 久久成人精品视频| 久久99精品久久久久久久不卡 | 久久久久久青草大香综合精品| 亚洲中文字幕无码久久2020| 综合久久精品色| 久久亚洲国产精品123区| 亚洲成人精品久久| 中文字幕一区二区三区久久网站| 久久精品午夜一区二区福利| 久久久www免费人成精品| 一本大道久久东京热无码AV| 香蕉久久永久视频| 久久婷婷人人澡人人| 久久强奷乱码老熟女网站| 国产精品99久久不卡| 国产巨作麻豆欧美亚洲综合久久 | 久久国产成人精品麻豆| 国产精品久久久久影视不卡| 久久er国产精品免费观看2| 青青青国产精品国产精品久久久久|