回 帖 发 新 帖 刷新版面

主题:Qbasic 请求帮助

我们老师给我们发了一项作业,但我试了很久也没有搞出来。 请各位大侠帮帮忙,搞一下啊, 谢谢
搞出来后传到我Email上chirdis@126.com
谢谢



下面是问题:
Assignment #1:   The Bank Machine


Overview:  You are to simulate an automatic teller machine (ATM) for an imaginary bank.

 *************************************************************************
*                                        *
*                The Bank of Bob                    *
*                                        *
*                                        *
*            1.     Deposit                        *
*            2.     Withdraw                        *
*            3.      Balance                        *
*            4.      Quit                        *
*                                        *
*            Please enter an option now: 4                *
*                                        *
*************************************************************************



Specifics:

1.    You do not have to call your bank “The Bank of Bob”.  In fact, you are not allowed to call your bank the Bank of Bob.  Pick another name.

2.    Your simulation must include:

•    a main screen with the following menu:
1.    deposit
2.    withdraw
3.    balance
4.    exit

•    an exit screen (i.e. “Thank you for using bank of BOB!”)

•    a login screen with a pin entry. Your PIN code should be 12345.  Don’t get creative and change it so I have to guess your pin number!  Don’t worry, you won’t be losing any real money – this is just a simulation.  The user is allowed THREE TRIES to enter the PIN before it gets the boot.

3.    Each option (deposit, withdraw, balance, quit) should be on its own screen, coloured and centred with a border.

4.    You will need to follow these restrictions:


•    Deposit:        Do not accept negatives (a deposit of ZERO is OK)

•    Withdraw:    Do not accept negatives (zero ok)
Only accept multiples of $20
Cannot overdraw (can’t take out more than you have)
Cannot draw more than $500 from account at one time



Final notes:

•    The client should be given an initial balance of $600.
•    The program should loop back to the main menu after each option, except when they choose to quit.




Marks will be given for 

* function (does it work smoothly)
* presentation (menus are centered properly)
* creativity (use of colour, decorative borders, etc)
* code form – proper indents, good variable names, program header, comments




DUE DATE:  Roughly next Wed at end of class.  This gives you one whole week.  






What you will need

Before you begin, you will need to understand the following functions:


1.    Color         -- this function changes the color of the text

Example:  COLOR 14        ‘use a yellow pen

2.    Locate        -- this function puts the cursor at row, col

Example:  Locate 2, 10        ‘puts the cursor on the 2nd row, 10th column.

Note:   The text screen is 80 columns by 20 rows, approximately.

3.    PRINT USING   -- this sets the format of the next print statement 

Example:  PRINT USING “$####.##”; 5        ‘ will print $5.00

This is useful when printing out dollar amounts.  For example:

PRINT 100/3

Will print 33.333333333...

PRINT USING “$##.##”; 100/3

Will print $33.33



4.    SLEEP   -- this function pauses the program for a given number of seconds.  

Example: SLEEP 3             ‘pauses for 3 seconds.  

Keep in mind, 3 seconds is a long……………………………time!

5.    MOD   -- You will need this operator to determine if a withdrawal is a multiple of $20.

IF variable MOD 20 = 0 THEN

回复列表 (共7个回复)

沙发

搞出来还要传到你邮箱啊...要求太多了吧









[img]http://bbs.pfan.cn/image/qianming.gif[/img]
[url=http://www.021website.com]域名注册[/url]、[url=http://www.021website.com/mail.asp]企业邮箱[/url]、[url=http://www.021website.com/hosting.asp]虚拟主机[/url]优质服务机构

板凳


呵呵,不好意思哈,不用一定发到我邮箱里,你也可以直接回帖子。  谢谢

3 楼

_-~~~-.______/==\_ 
              /'_,\         \ `~~~
              `' _( ,_..--\ ( 
               /~~//'   /' `~\
              "  `~"   "      `"

4 楼

好久米有流泪了

5 楼

lz,你穿的是兰州布裤吗

6 楼

没有兰州的日子里,我依旧布裤了

7 楼

天涯易老,何枝可依,你们就是传说中的某色生死恋么

我来回复

您尚未登录,请登录后再回复。点此登录或注册