Question

If you could please assist me with this C# assignment. Screenshots would be greatly appreciated! Create...

If you could please assist me with this C# assignment. Screenshots would be greatly appreciated! Create a Windows application using C# visual studio that functions like a banking account register. The graphical user interface should initially allow the user to input the account name, number, and initial balance. Ensure that the full name is entered for the customer and that only numeric values are entered for number fields when the Create Account button is selected. Separate the business logic from the presentation layer by creating a Customer class. Include a deposit to and withdraw from methods in the Customer class to keep the balance updated. After an object of the Customer class is instantiated, provide textbox objects on your GUI for withdrawals and deposits. A second button should be available to update the account for withdrawal and deposit transactions showing the new balance. Can you please show the design code for the form?

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

Customer.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BankApplication
{
class Customer
{
  
public string custname;
public int accNo;
public double balance;

public Customer(string name, int acc, double bal)
{
custname = name;
accNo = acc;
balance = bal;
}

public void deposit(double amount)
{
balance = balance + amount;
}

public void withdraw(double amount)
{
balance = balance - amount;
}

public double showBalance()
{
return balance;
}
  
}
}

Form1.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BankApplication
{
public partial class Form1 : Form
{
Customer c1;
public string name;
public int acc;
public double bal, amountW, amountD;
public double wiDrw, dep;
public Form1()
{
InitializeComponent();
}

private void btn_create_Click(object sender, EventArgs e)
{
string msg = "";
name = txtName.Text;
msg = msg + name + Environment.NewLine;
acc = Convert.ToInt32 (txtAccNum.Text);
msg = msg + acc + Environment.NewLine;
bal = Convert.ToDouble(txtBalance.Text );
msg = msg + bal + Environment.NewLine;
  
MessageBox.Show("Account created successfully!!"+Environment.NewLine+ msg);
c1 = new Customer(name, acc, bal);
}

private void Form1_Load(object sender, EventArgs e)
{
if(txtDeposit.Text=="" )
{
txtDeposit.Text = "";

}
if (txtWithdraw.Text =="" )
{
txtWithdraw.Text = "";
}
}

private void btn_update_Click(object sender, EventArgs e)
{


if (txtWithdraw.Text != "")
{

c1.withdraw(Convert.ToDouble(txtWithdraw.Text ));
txtBalance.Text = c1.showBalance().ToString();
txtWithdraw.Clear();
}

if (txtDeposit.Text != "")
{
c1.deposit (Convert.ToDouble(txtDeposit.Text ) );
txtBalance.Text = c1.showBalance().ToString();
txtDeposit.Clear();
}
if (txtDeposit.Text=="" && txtWithdraw.Text=="")
{
MessageBox.Show("Please enter withdrawal or deposit amount");
}
}
}
}

Form1.cs[Design]

Quick Launch (Cti 刈BankApplicationRunngl, MicrosoftVisual Stude File Edit View Project Baild Debug Team Tools Test Analyce Wi

Add a comment
Know the answer?
Add Answer to:
If you could please assist me with this C# assignment. Screenshots would be greatly appreciated! Create...
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
  • USE RAPTOR PLEASE Could you please help me to create a FLOWGORRITHM for the following information?...

    USE RAPTOR PLEASE Could you please help me to create a FLOWGORRITHM for the following information?   I need only FLOWGORRITHM showing flowchart with PICTURES (STEPS). Please help me You are writing a FLOWGORRITHM program that will act like an ATM machine. In order to access the ATM, the customer must enter their user name and their passcode. The list of legitimate users along with their user ID, passcode and account balance is provided to you below. There are only 3...

  • JAVA PLEASE Create a class called Account with the following instance data Integer id Double balance...

    JAVA PLEASE Create a class called Account with the following instance data Integer id Double balance Provides the following methods Default constructor (defaults balance to 100) Constructor with parameters for the ID and the starting balance Accessor and mutator methods for id and balance Method to perform a withdrawal Method to perform a deposit Create a class called Bank which has an array of Account objects. This class will manage the accounts. It must provide methods Do withdrawal Do deposits...

  • C++ Please create the class named BankAccount with the following properties below: // The BankAccount class...

    C++ Please create the class named BankAccount with the following properties below: // The BankAccount class sets up a clients account (name & ID), keeps track of a user's available balance. // It also keeps track of how many transactions (deposits and/or withdrawals) are made. public class BankAccount { Private String name private String id; private double balance; private int numTransactions; // Please define method definitions for Accessors and Mutator functions below Private member variables string getName(); // No set...

  • Purpose: Demonstrate the ability to create and manipulate classes, data members, and member functions. This assignment...

    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 100 accounts. Use an array of pointers to objects for this. However, your...

  • Create an Inheritance hierarchy that a bank may use to represent customer's bank accounts (Checking and...

    Create an Inheritance hierarchy that a bank may use to represent customer's bank accounts (Checking and Savings), this includes a GUI user interface that allows user to login, and deposit or withdraw, and application to display the transaction and final balance. All the bank customers can: - Create a new account - Deposit (Credit) money into their account and/or withdraw (debit) money from their account. - Application should expect user to login to their account using login/password Create necessary classes...

  • 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...

  • You will create an HTML file that contains input elements with event-handling capabilities according to the...

    You will create an HTML file that contains input elements with event-handling capabilities according to the requirements listed on the next page. The program that processed the Banking Transactions in the previous assignment needs a makeover to accept data using text boxes. The results will be displayed on the same rows that contain the transactions. (Balance, Deposit, Withdrawal). The requirements for calculating the final balances and producing special messages (if applicable) remain unchanged. However, the initial balance will not be...

  • C++ Design a class bankAccount that defines a bank account as an ADT and implements the...

    C++ Design a class bankAccount that defines a bank account as an ADT and implements the basic properties of a bank account. The program will be an interactive, menu-driven program. a. Each object of the class bankAccount will hold the following information about an account: account holder’s name account number balance interest rate The data members MUST be private. Create an array of the bankAccount class that can hold up to 20 class objects. b. Include the member functions to...

  • 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...

  • This is in C++ (using IDE Visual Studio). I am seeking assistance ASAP. Please include a...

    This is in C++ (using IDE Visual Studio). I am seeking assistance ASAP. Please include a static member in the class to automatically assign account numbers (used to process up to 10 accounts) and have the user include their first and last name. Thank you! 13. a. Define the class bankAccount to store a bank customer's account number and balance. Suppose that account number is of type int, and balance is of type double. Your class should, at least, provide...

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