• <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久久99久久精品国产片果冻 | 国产精品久久自在自线观看| 国内精品久久国产大陆| 久久se精品一区二区| 久久久久噜噜噜亚洲熟女综合| 亚洲国产日韩综合久久精品| 国产高潮国产高潮久久久| 久久AⅤ人妻少妇嫩草影院| 人人妻久久人人澡人人爽人人精品| 婷婷伊人久久大香线蕉AV| AA级片免费看视频久久| 狠狠精品久久久无码中文字幕| 亚洲伊人久久大香线蕉苏妲己| 久久久久久久免费视频| 日本免费久久久久久久网站| 中文字幕久久久久人妻| 精品久久久久中文字幕一区| 久久久久久亚洲精品成人 | 久久久无码精品亚洲日韩按摩| 国产一区二区精品久久凹凸| 亚洲精品白浆高清久久久久久| 亚洲а∨天堂久久精品9966| 欧美日韩中文字幕久久伊人| 无码人妻少妇久久中文字幕蜜桃 | 乱亲女H秽乱长久久久| 亚洲精品无码久久不卡| 99精品伊人久久久大香线蕉| 亚洲精品无码久久千人斩| 午夜精品久久久久成人| 久久夜色撩人精品国产| 品成人欧美大片久久国产欧美... 品成人欧美大片久久国产欧美 | 久久亚洲AV无码精品色午夜麻豆| 精品久久久久久无码中文字幕| 国产精品久久久久影院嫩草 | 无码AV波多野结衣久久| 久久精品国产精品亚洲精品| 久久久久久久综合狠狠综合| 久久久久高潮综合影院| 亚洲国产精品无码久久SM| 久久er99热精品一区二区|