Preview

Code

Good Essays
Open Document
Open Document
684 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Code
Name: Zachary Quek Suan Chieh I.D.: 112051-06965-010 Course: BCS

account.h using namespace std; class Account{ protected: double balance; public: Account(double x){ balance = x;} virtual double getBalance(); virtual double debit(double x); virtual double credit(double x);};

account.cpp
#include<iostream>
#include"account.h" using namespace std; double Account:: debit(double x){ if(x>balance){ cout << "Debit amount exceeded account balance." << endl;} else{balance = balance - x;} return balance;} double Account:: credit(double x){ balance = balance + x; return balance;} double Account::getBalance(){ return balance;};

savingaccount.h using namespace std; class SavingAccount : public Account { private: double interest; public: SavingAccount(double x,double y); double calculateInterenst(double x);};

Savingaccount.cpp
#include<iostream>
#include"account.h"
#include"savingaccount.h"
using namespace std;
SavingAccount::SavingAccount(double x, double y): Account(x){ balance =x ; interest =y;} double SavingAccount::calculateInterenst(double x){ x = balance * interest; return x;}

Checkingaccount.h using namespace std; class CheckingAccount : public Account{ private: double fee; public: CheckingAccount(double x, double y); virtual double debit(double x); virtual double credit(double x);};
Checkingaccount.cpp
#include<iostream>
#include"account.h"
#include"checkingaccount.h" using namespace std;
CheckingAccount :: CheckingAccount(double x, double y): Account(x){ balance =x ; fee =y;} double CheckingAccount :: debit(double x){ if(x>balance){cout << "Debit amount exceeded account balance." << endl;} else{ balance = balance - x; cout << "$" << fee << " transaction fee charged." << endl; balance = balance - fee; return balance;}} double CheckingAccount :: credit(double x){ balance = balance + x;

You May Also Find These Documents Helpful

  • Good Essays

    Amath 250 notes

    • 36731 Words
    • 354 Pages

    1.2.7 A common error . . . . . . . . . . . . . . . . .…

    • 36731 Words
    • 354 Pages
    Good Essays
  • Satisfactory Essays

    A Programmed

    • 418 Words
    • 2 Pages

    A programmed decision applies a solution from a past experience to a routine problem. A non-programmed decision applies a specific solution crafted for a unique problem. Decision scope refers to the range or boundaries that you must work within when making a decision. If the decision pertains to a project, it involves what the project is supposed to accomplish and the budget of both time and money that has been created to achieve these objectives…

    • 418 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Java

    • 490 Words
    • 3 Pages

    Write a Java program to demonstrate using bitmaps and bitwise operators to sort and remove duplicates from a file of random phone numbers. Do not confuse the term bitmap used for compressing data into smaller spaces with the bitmap that has come to mean a graphic image.…

    • 490 Words
    • 3 Pages
    Good Essays
  • Better Essays

    Code Switching

    • 2809 Words
    • 12 Pages

    Code switching is a surviving skill that some bilingual people and students encompass, sometimes to compensate for the lack of vocabulary in a certain language. It is defined as language alteration between two languages, transferring from one language to another in the course of a conversation (Brice, p. 10) In the teaching field code-switching has a great importance because it can be used by teachers or students in story telling to aid interaction, comprehension, and classroom participation, since the development of literacy requires comprehension narrative, and vocabulary skills, code-switching offers help in this aspect. For those who are bilingual especially in Spanish and English, code switching may be also called "Chiconics." This term is not widely know Chiconics it is positive for social interaction with those who share the same languages and culture, for those who are learning a second language the use of code-switching is very important to enhance meaning. The use of code-switching does not portray that the student is confused between two languages instead it let others see that they have knowledge of the two languages and or that they are attempting to learn the language. The use of code-switching has many positive uses for bilingual students who are attempting to learn a second language.…

    • 2809 Words
    • 12 Pages
    Better Essays
  • Satisfactory Essays

    Action Replay Codes

    • 1233 Words
    • 5 Pages

    Please note that the Game IDs for Blaze Black and Volt White are not the same as the game IDs for Black and White. Use the IDs given below.…

    • 1233 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Skyrim Codes : P

    • 1594 Words
    • 7 Pages

    Hit Tilde [`] to bring down the developer console. Then just enter the codes listed below to activate.…

    • 1594 Words
    • 7 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Purpose of Coding

    • 292 Words
    • 2 Pages

    Diagnoses, signs, and symptoms are all assigned codes. Those codes are entered on insurance claims which results in uniform reporting of medical reasons for healthcare. Codes are used for reimbursement claims, alerting other healthcare professionals to allergies, and notating diagnoses and procedures in a patient’s medical record.…

    • 292 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Php Codes

    • 3482 Words
    • 14 Pages

    This article is about the line of tablet computers designed and marketed by Apple Inc. For specific later models and other uses, see iPad (disambiguation).…

    • 3482 Words
    • 14 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pin Codes

    • 1168 Words
    • 5 Pages

    Here is the list of all Pin Codes of Thane as per areas and places which comes under every post office. Pin Codes of Thane starts from 601 and the main Thane Head Office has zip code of 400601. Here is the full list of all codes -…

    • 1168 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Barcode

    • 362 Words
    • 2 Pages

    | robustness in practical use and tiny code size, and this is implemented in our mobile application processor architecture which has embedded host CPU, DSP, camera interface, and LCD controller.…

    • 362 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Barcode

    • 2686 Words
    • 11 Pages

    This study focuses on barcode recognition from images of barcode stamped products, acquired by different cameras. First step in recognition of barcode data is achieving barcode localization. For this purpose, a Fast Hough Transform Approximation has been developed. With this method, barcode localization and the angular orientation of the barcode is obtained. In order to decipher barcode data, the scan line obtained by barcode localization and angular orientation information are used. However, the image resolution has to be good enough so that the bar code data could be read properly. In this work, image quality is improved with methods of B-Spline Smoothing and super-resolution techniques. Later, barcode data is deciphered via match filtering. The proposed barcode reading system is tested and results are discussed.…

    • 2686 Words
    • 11 Pages
    Powerful Essays
  • Powerful Essays

    Code Switching

    • 3319 Words
    • 14 Pages

    Code-switching is a very interesting aspect of bilingualism that has recently received considerable attention from linguists. It is defined as "the use of more than one language by communicants in the execution of a speech act"(1) or "the alteration of two languages"( 2) or " the use of two or more linguistic varieties in the same conversation or interaction.”( 3)…

    • 3319 Words
    • 14 Pages
    Powerful Essays
  • Satisfactory Essays

    Eurocode

    • 598 Words
    • 3 Pages

    1. MIND MAP 2. INTRODUCTION 3. EUROCODE 3 4. CROSS SECTION CLASSIFICATION 5. DESIGN OF ELEMENTS 6. WORK EXAMPELS…

    • 598 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Personal code

    • 1043 Words
    • 3 Pages

    Well my first on is forgive and forget I like to try and live by this one. The only reason why I like to try to live by this one is because I have had experience with being in a fight with some of my friends. When I got into fights with my friends I and a stubborn girl and I wouldn’t forgive them well then I ruined a friendship. I forgive the ones that I can but if they did something that I think is unforgivable the I won’t apologize. Lately I have been forgiving the ones that I can and forgetting what had happened between us. It is better to forgive and forget.…

    • 1043 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    The Pokemon Codes

    • 4612 Words
    • 19 Pages

    POKEMANKHAN's Cheat List For Pokemon Emerald Visual Boy Advance: Infinte Money: d8bae4d9 4864dce5 a86cdba5 19ba49b3 a57e2ede a5aff3e4 1c7b3231 b494738c c051ccf6 975e8da1 [Master] code: 00006FA7 000A 1006AF88 0007 Buy Master Ball: 82005274 0001 Rare Candies: 82005274 0044 Walk Through Walls: 7881A409 E2026E0C C56CFACA DC167904…

    • 4612 Words
    • 19 Pages
    Satisfactory Essays

Related Topics