Programming: Contemporary Concepts
Assignment 3 & 4 / Test 2 | Semester 1 & 2 | 2023
✓ This document contains all the necessary code and screenshots (output) for all
3 questions.
✓ Assignment 3: Q1 –BankAccount (Console) | Q2 – TrafficLight (GUI)
✓ Assignment 4/Test 2: Q3 – StockRecorder(GUI)
✓ For more understanding the last page has a link to Google Drive to the entire
project in Qt. Just download and run in Qt to view and test working project.
All requirements have been fulfilled and all 3 projects are 100%
compiling!!!
, QUESTION 1: BankAccount (Console Application)
Files
Code (Header Files)
balanceenquiry.h
#ifndef BALANCEENQUIRY_H
#define BALANCEENQUIRY_H
#include "transaction.h"
class BalanceEnquiry : public Transaction {
public:
BalanceEnquiry(const std::string& dateTime);
double computeCost() const override;
};
#endif // BALANCEENQUIRY_H
deposit.h
#ifndef DEPOSIT_H
#define DEPOSIT_H
#include "transaction.h"
class Deposit : public Transaction {
private:
double m_Fee;
public:
Deposit(const std::string& dateTime, double fee);
double computeCost() const override;
std::string toString() const override;
};
#endif // DEPOSIT_H