logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Porter HughesPolitical science
(5/5)

835 Answers

Hire Me
expert
Anup GodaraAccounting
(5/5)

778 Answers

Hire Me
expert
Jon CulshawComputer science
(5/5)

774 Answers

Hire Me
expert
Sandhya SharmaBusiness
(5/5)

962 Answers

Hire Me
Excel
(5/5)

If all these conditions are met, then validator will return true and transaction can be saved

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Home assignment

Introduction

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 steps

First add a button on the existing excel sheet. It will be something like that:

Class diagram 

Figure 1 New button for opening a form 

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

Figure 2 Class diagram for VBA code

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

Figure 3 Main user functions

As shown on the use case diagram user can have 2 functions available:

1. Add new transaction

2. Load transaction history

Add transaction

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:

Figure 4 Example of a user form

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:

Figure 5 New Excel sheet for storing transactions

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.

Load transaction history

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: 

Figure 6 Transaction history list

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

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

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

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme