Question
Question: I am getting errors in this code. What am I doing wrong here? How do I get the code to count the coins in
Question:
I am getting errors in this code. What am I doing wrong here?
How do I get the code to count the coins in my .csv file?
Below is the code and an attachment of my errors:
#include
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include "doctest.h"
class Crypto {
struct Coins { int rank; string name; string symbol; double marketCap; };
fstream file; vector
public: bool OpenFile(string fileName) { myFile.open(fileName); if (!myFile.is_open()) { cout
int ParseCurrencies() { vector } int CountCoinsStartingWithLetter(char a) { vector string name; int cnt = 0; for (int i = 0; i TEST_CASE("Testing the Crypto Coins Class") { Crypto cryptos; CHECK(cryptos.OpenFile("Coins.csv") == true); CHECK(cryptos.ParseCurrencies() == COUNT_COINS); CHECK(cryptos.CountCoinsStartingWithLetter('a') != 5); CHECK(cryptos.CountCoinsStartingWithLetter('a') == 6); CHECK(cryptos.CountCoinsStartingWithLetter('a') != 7); }; ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started