Skip to content

Instantly share code, notes, and snippets.

Write a C++ program that
Accepts a file name from the user
Reads the numbers in that file and stores them in a vector
Checks the numbers in the vector to ensure that they are sorted
Accepts a file name from the user
Reads pairs of numbers, lower bound and upper bound, from that file one pair at a time
For each pair of bounds
**Calculates the between bounds count: the number of doubles in the vector that lie between the bounds
Reports the bounds and the between bounds count
@aryelleification
aryelleification / CountLT.cpp
Last active August 29, 2015 14:06
CountLT Code
//CountLT.cpp
//Aryelle Young
//Sep 23 2014
//Defines the CountLT class
#include "CountLT.h"
//Default Constructor
//takes a value from client code to use as initial bound
CountLT::CountLT(double bound) : the_bound(bound), count(0)