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

            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.

            久久国产精品久久精品国产| 久久棈精品久久久久久噜噜| 2020最新久久久视精品爱| 丁香五月综合久久激情| 亚洲欧美国产日韩综合久久| 狠狠色丁香久久婷婷综合_中| 久久亚洲精品无码AV红樱桃| 91精品国产综合久久四虎久久无码一级 | 99麻豆久久久国产精品免费| 久久国产乱子伦精品免费午夜| 亚洲国产精品无码久久久久久曰| 久久久久久久国产免费看| 国产精品成人99久久久久91gav| 日韩十八禁一区二区久久| 久久99久国产麻精品66| 久久精品无码一区二区日韩AV | 中文字幕久久久久人妻| 国产V综合V亚洲欧美久久| 伊人久久大香线蕉精品不卡| 国产成人AV综合久久| 无码国内精品久久综合88| 亚洲国产精品人久久| 精品人妻伦九区久久AAA片69| 国产精品九九久久免费视频| av无码久久久久不卡免费网站| 污污内射久久一区二区欧美日韩| 久久久精品一区二区三区| 7777精品久久久大香线蕉| 欧美与黑人午夜性猛交久久久| 久久青青草原精品影院| av无码久久久久不卡免费网站| 精品伊人久久大线蕉色首页| 怡红院日本一道日本久久| 亚洲中文精品久久久久久不卡| 人妻无码久久精品| 久久一本综合| 伊人久久大香线蕉精品不卡| 东方aⅴ免费观看久久av| 日产精品久久久久久久| 久久久噜噜噜久久中文字幕色伊伊| 久久久这里有精品|