Question

how can i code this only using a textbox for results Create Windows Forms applications called...

how can i code this only using a textbox for results Create Windows Forms applications called ATM Project that allows the customer to deposit the initial amount and enter the amount to be withdrawn. You need to display the total amount in the account, dispenses the money to the customer, and debits the account by the amount withdrawn including any service charges.

The ATM allows a customer to withdraw a maximum of $500 per transition in $20 increments. If a customer withdraws more than $300, the service charge is 4% of the amount over $300. If the customer does not have sufficient money in the account, the ATM informs the customer about the insufficient funds and gives the customer the option to withdraw the money for a service charge of $25. If there is no money in the account or if the account balance is negative, the ATM does not allow the customer to withdraw any money. If the amount to be withdrawn is greater than $500, the ATM informs the customer about the maximum amount that can be withdrawn.

 

ex)

Deposit Amount:                    1,000
Withdrawn Amount:                 300
Amount Withdrawn................ $300
Amount of Fees............................ $0
Account Balance.......................$700

=================================

Deposit Amount:                     $700
Withdrawn Amount:                $500
Amount Withdrawn................ $500
Amount of Fees............................ $8
Account Balance.......................$192

=================================

Deposit Amount:                    $192
Withdrawn Amount:               $200

Insufficient funds for this withdrawal
This is a $25.00 service charge
would you like to continue?  (Y/N): y
Amount Withdrawn................ $200
Amount of Fees.......................... $25
Account Balance.......................$-33
?

windows visual basic vb Windows Forms app i am only using a textbox for display

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here, we have to create a form with four labels, four textboxes and one button.

Component. Name and text property

label1 Deposit Amount

label2. Withdrawn Amount

label4. Amount of Fees

label5. Account Balance

TextBox1 . txtDeposit

TextBox2 . txtWithdrawn

TextBox4. txtFees

TextBox5. txtBalance

Button1. btnWithdraw

Drag and drop all these components to the form. Then do the following.

  • Change the text property of all the label to above mentioned text
  • Change the name property of all the textboxes to above mentioned way.
  • Change the name and text property of button into btnWithdraw and Withdraw respectively.
  • Double click the button, you will redirected to the code.
  • Write the code in the following manner
Private Sub btnWithdraw_Click()
dim deposit as Integer
'deposit variable for storing deposit amount
dim withdraw, balance as Integer
Dim result as Integer
'result for storing msgbox response.
deposit=val(txtDeposit.Text)
'deposit stores value from textbox
withdraw=val(txtWithdraw.Text)
'withdraw stores value from txtwithdraw

if withdraw > deposit and deposit > = 0 Then
result=MsgBox("insufficient funds for this withdrawal. This is a $25.00 service charge. Would you like to continue...(Y/N)?", vbYesNo)

'we have to check the withdraw amount is greater or not than the deposit amount, if yes then this if block will executed. 
'Also, There should arise a message box with yes or no button. result variables stores the response.
if result=vbYes Then
txtFees.Text="$25"
'If we click on yes, then txtFees assignes a fees of $25.
balance=(deposit-withdraw)-25
'calculate balance as above
txtBalance.Text= CStr(balance)
'convert integer value balance to string and assign it to textbox
end If
else if deposit < 0 Then
MsgBox("You cannot withdraw money, because of your account has not suffient balance")
'if deposot is a negative value, then transaction not possible message will occur

else If withdraw>500 Then
MsgBox("Maximum amount to withdraw is 500")
'if withdraw amount is greater than 500, then it also shows aboce message

else if withdraw>300 and withdraw<=500 Then
b=(withdraw-300)*(4/100)
'b stores fees by 4%
txtFees.Text=CStr(b)
'convert b to string and assign it to txtFees textbox
balance=(deposit-withdraw)-b
txtBalance.Text=CStr(balance)
'if withdraw amount is greater than 300 and less than 500, user should pay 4% tax of amount increased.
Else
balance=deposit-withdraw
txtFees.Text="$0"
txtBalance=CStr(balance)
'If withdraw amount is with the range and below 300, then fees assign to 0, balance calculated as usual way.
End If
End Sub

Add a comment
Know the answer?
Add Answer to:
how can i code this only using a textbox for results Create Windows Forms applications called...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Perform a desk check for each case and verify that the algorithm produces the expected results....

    Perform a desk check for each case and verify that the algorithm produces the expected results. A template is attached to use for the desk check. (Please help me with this) An ATM allows a customer to withdraw a maximum of $500 per day. If a customer withdraws more than $300, the service charge is 4% of the amount over $300. If the customer does not have sufficient money in the account, the ATM informs the customer about the insufficient...

  • This assignment must be completed on your own with your team mates. Don't give your code...

    This assignment must be completed on your own with your team mates. Don't give your code to others or use other students' code. This is considered academic m will result 0 marks) Write a java program that mange JUC Bank accounts services. The program should have the following: The total number of accounts (n) will be specified by the user at the beginning of the program. Depending upon the entered number, create three Arrays as following o o o Array...

  • BANKING MANAGEMENT

    Banking System is developed in C++ to replaced manual System by a computerized system. This system allows to create a new account and Allows to deposit and withdrawal amount facilities. Account Holder ABS must record the detailed information of each account holder, such as  Type of his account (see next slides for more info)  Type of Credit card (see later slides for more info)  First name, middle name, and last name  CNIC number Address Telephone number Date of...

  • I need to update the code listed below to meet the criteria listed on the bottom....

    I need to update the code listed below to meet the criteria listed on the bottom. I worked on it a little bit but I could still use some help/corrections! import java.util.Scanner; public class BankAccount { private int accountNo; private double balance; private String lastName; private String firstName; public BankAccount(String lname, String fname, int acctNo) { lastName = lname; firstName = fname; accountNo = acctNo; balance = 0.0; } public void deposit(int acctNo, double amount) { // This method is...

  • TASK 1 Create a new class called CheckingAccount that extends BankAccount. It should contain a static...

    TASK 1 Create a new class called CheckingAccount that extends BankAccount. It should contain a static constant FEE that represents the cost of clearing onecheck. Set it equal to 15 cents. Write a constructor that takes a name and an initial amount as parameters. Itshould call the constructor for the superclass. It should initializeaccountNumber to be the current value in accountNumber concatenatedwith -10 (All checking accounts at this bank are identified by the extension -10). There can be only one...

  • Should be in C# Create an inheritance hierarchy that a bank might use to represent customers’...

    Should be in C# Create an inheritance hierarchy that a bank might use to represent customers’ bank accounts. All customers at this back can deposit (i.e. credit) money into their accounts and withdraw (i.e. debit) money from their accounts. More specific types of accounts also exist. Savings accounts, for instance, earn interest on the money they hold. Checking accounts, on the other hand, charge a fee per transaction. Create base class Account and derived classes SavingsAccount and CheckingAccount that inherit...

  • For this week's assignment , please create an application following directions in the attached document.(windows form...

    For this week's assignment , please create an application following directions in the attached document.(windows form application) Create a base class named Account and derived classes named SavingsAccount and CheckingAccount that inherit from class Account. Base class Account should include one private instance variable of type decimal to represent the account balance. The class should provide a constructor that receives an initial balance and uses it to initialize the instance variable with a public property. The property should validate the...

  • [JAVA] < Instruction> You are given two classes, BankAccount and ManageAccounts ManageAccounts is called a Driver...

    [JAVA] < Instruction> You are given two classes, BankAccount and ManageAccounts ManageAccounts is called a Driver class that uses BankAccount. associate a member to BankAcount that shows the Date and Time that Accounts is created. You may use a class Date. To find API on class Date, search for Date.java. Make sure to include date information to the method toString(). you must follow the instruction and Upload two java files. BankAccount.java and ManageAccounts.java. -------------------------------------------------------------------------- A Bank Account Class File Account.java...

  • In C++ Create an inheritance hierarchy that a bank might use to represent customers’ bank accounts. All customers at this bank can deposit (i.e., credit) money into their accounts and withdraw (i.e.,...

    In C++ Create an inheritance hierarchy that a bank might use to represent customers’ bank accounts. All customers at this bank can deposit (i.e., credit) money into their accounts and withdraw (i.e., debit) money from their accounts. More specific types of accounts also exist. Savings accounts, for instance, earn interest on the money they hold. Checking accounts, on the other hand, charge a fee per transaction (i.e., credit or debit). Create an inheritance hierarchy containing base class Account and derived...

  • Need some help with this C++ code. Please screenshot the code if possible. Purpose: Demonstrate the...

    Need some help with this C++ code. Please screenshot the code if possible. Purpose: Demonstrate the ability to create and manipulate classes, data members, and member functions. This assignment also aims at creating a C++ project to handle multiple files (one header file and two .cpp files) at the same time. Remember to follow documentation and variable name guidelines. Create a C++ project to implement a simplified banking system. Your bank is small, so it can have a maximum of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT