In the second home assignment we will use the original excel file from the first home assignment. We add a button that shows a user form describing the very basic functions of a crypto portfolio. User can add a new transaction and load a history of existing transactions.
First add a button on the existing excel sheet. It will be something like that:
Class diagram describes the main classes and enumerations in VBA code. For our system we need one class for transaction itself (Transaction) and transaction validator to validate the user input (TransactionValidator). Transactions can be both debit (if user buys something) and credit (if user sells something).
The transaction has public fields for the name of the currency, its quantity, exchange rate, date and type. For example, if user wants to add a transaction that he bought 2 bitcoins with a price of 3500 USD each we will have a transaction object with fields:
• Transaction
o CryptoCurrency = “Bitcoin”
o ExchangeRate = 3500
o Quantity = 2
o TransactionType = Debit
o TransactionDate = current date (just fill it automatically to current date) Transaction validator should check that
• Transaction object exists (Not Nothing)
• CryptoCurrency is filled (not an empty string)
• Quantity is more than 0
• Exchange rate is more than 0
If all these conditions are met, then validator will return true and transaction can be saved otherwise show message box saying something like “Please enter correct data.”
Use case models
As shown on the use case diagram user can have 2 functions available:
1. Add new transaction
2. Load transaction history
When user adds a transaction it is being validated and if valid then stored in the excel sheet called “Transactions” (or some other name). For entering transaction details please use a form similar to:
On the left side you can see different GUI components for entering transaction details:
1. Combobox for currency name. Currencies should be taken from the original sheet (A11 : A20). To fill the ComboBox use its property RowSource
2. Input for Quantity (TextBox)
3. Input for Exchange rate (TextBox)
4. Frame for Buy or Sell options with radio groups
5. Button “Add transaction”
To save transaction, first create the second sheet similar to:
Please note that new transaction is added always on the second row (A2: E2). To keep existing transactions and not to override them with a new one shift existing ones down with
Worksheets("Transactions").Rows(2).Insert Shift:=xlDown
After that you can add your new data to the second row.
To load transaction history you need to read them from the “Transactions” sheet starting from the second row (A2 : E2) until the first empty row. Just check A column and if it is empty then stop reading.
To simplify showing transactions in a ListBox implement method ToString() in Transaction class, so your transaction history will look similar to:
ToString() method return a string that is a concatenation of transaction fields, separated with a
whitespace and words like “quantity: ” and “rate: ”. You can select how do you want to show transaction in a list, the main requirement that it is readable.
After transactions are loaded, calculate totals for debit and credit transactions and show them in appropriate inputs Total Debit and Total Credit.
Requirements
The successful solution should include:
• Classes
• Enum
• Loops
• IF ELSE structures
• The usage of Collection
• Functions
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme