Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, I need help with one of my question please? the main.cpp is here i want complete code. best regards #include #include #include BirthAnalysis.h using

Hello,

I need help with one of my question please? the main.cpp is here i want complete code.

best regards

#include

#include

#include "BirthAnalysis.h"

using namespace std;

template

bool testAnswer(const string &nameOfTest, const T& received, const T& expected) {

if (received == expected) {

cout << "PASSED " << nameOfTest << ": expected and received " << received << endl;

return true;

}

cout << "FAILED " << nameOfTest << ": expected " << expected << " but received " << received << endl;

return false;

}

int main() {

{

cout << "Testing with small data file ..." << endl;

BirthAnalysis b("data1.txt");

testAnswer("data1.txt: totalNumberOfBirths", b.totalNumberOfBirths(), 10);

testAnswer("data1.txt: numberOfBirths in Stanislaus_County", b.numberOfBirths("Stanislaus_County"), 2);

testAnswer("data1.txt: countyWithMostBirths", b.countyWithMostBirths(), (string)"Sutter_County");

}

{

cout << "Testing with large data file ..." << endl;

BirthAnalysis b("data2.txt");

testAnswer("data2.txt: totalNumberOfBirths", b.totalNumberOfBirths(), 3076);

testAnswer("data2.txt: numberOfBirths in Calaveras_County", b.numberOfBirths("Calaveras_County"), 81);

testAnswer("data2.txt: countyWithMostBirths", b.countyWithMostBirths(), (string)"Amador_County");

}

// system("pause"); // uncomment to pause main program for testing in Visual Studio

return (0);

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago