Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //"I pledge my honor that I have abided by the Stevens Honor System" - ajmauceri
- //declaring libraries
- #include <iostream>
- #include <string>
- #include <cmath>
- #include <math.h>
- #include <map>
- #include <algorithm>
- #include <chrono>
- #include <ctime>
- #include <time.h>
- #include <stdio.h>
- #include <iomanip>
- #include "Bank.h"
- #include <string.h>
- #include <string>
- #include <fstream>
- //declaring namespace
- using namespace std;
- using namespace bank;
- //returns lowercase values of typed functions
- string stringToLower(string input)
- {
- transform(input.begin(), input.end(), input.begin(), tolower);
- return input;
- }
- //Using "an" or "a" in a sentence
- string aOrAn(string nextWord) {
- nextWord = stringToLower(nextWord);
- char firstChar = nextWord.at(0);
- if (firstChar == 'a' ||
- firstChar == 'e' ||
- firstChar == 'i' ||
- firstChar == 'o' ||
- firstChar == 'u')
- {
- return "an";
- }
- else {
- return "a";
- }
- }
- void SaveData() {
- string
- //1. open a real file on your hard drive
- writer.open("BankData.txt", ios::app); //Creates a file titled MyContact.txt and ios::app makes it so it only adds info without deleting previous data
- //2. Write 'name' and 'phone' onto that file we just opened
- writer << name << " " << phone;
- //3. Save and close that file.
- writer.close();
- }
- string LoadData() {
- ifstream reader;
- string newline;
- //1. Open a file so you can read from it
- reader.open("MyContacts.txt");
- //2. go ahead and read everything in it
- while (getline(reader, newline)) {
- cout << newline << endl;
- }
- //3. close the file
- reader.close();
- }
- //Capitalizing the first letter in a sentence
- string CapitalizeFirstLetter(string input) {
- input[0] = toupper(input[0]);
- return input;
- }
- //setting the color of a sentence
- void PrintMessageInColor(string message, int color) {
- cout << "\033[1;" << color << "m" << message << "\033[0m";
- }
- //standard color for Error Messages
- void PrintError(string message)
- {
- PrintMessageInColor(message, 31);
- }
- //setting a class for a transaction
- class Transaction
- {
- public:
- string name = "Transaction";
- float value = 0;
- Transaction(string transactionName, float initialValue) {
- name = transactionName;
- value = initialValue;
- }
- string ToString() {
- return name + " " + std::to_string(value) + "\r\n";
- }
- };
- //teaching the compiler what a bank account is
- class BankAccount
- {
- };
- int main()
- {
- for (; ; ) {
- auto now = std::chrono::system_clock::now();
- cout << now;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement