Question: (main.cpp) #include #include #include #include #include linkedList.h using namespace std; void getAllPuppiesFromFile (string filename, linkedList& allPuppies ) { istringstream inSS; ifstream input(filename); if (input.is_open()) {
(main.cpp)
#include
#include
#include
#include
#include "linkedList.h"
using namespace std;
void getAllPuppiesFromFile (string filename, linkedList& allPuppies )
{
istringstream inSS;
ifstream input(filename);
if (input.is_open()) {
Puppy newPuppy;
while (input >> newPuppy.name >> newPuppy.breed >> newPuppy.age ) {
allPuppies.insertLast(newPuppy);
}
}
else {
cout
}
}
int main ( int argc, char **argv )
{
linkedList allPuppies;
string filename = "puppies.txt";
getAllPuppiesFromFile ( filename, allPuppies );
if ( argc >= 2 ) {
allPuppies.printAll();
}
else {
allPuppies.printOldestPuppy();
}
return 0;
}
(linkedList.cpp)
#include
#include
#include
#include
#include "linkedList.h"
using namespace std;
void getAllPuppiesFromFile (string filename, linkedList& allPuppies )
{
istringstream inSS;
ifstream input(filename);
if (input.is_open()) {
Puppy newPuppy;
while (input >> newPuppy.name >> newPuppy.breed >> newPuppy.age ) {
allPuppies.insertLast(newPuppy);
}
}
else {
cout
}
}
int main ( int argc, char **argv )
{
linkedList allPuppies;
string filename = "puppies.txt";
getAllPuppiesFromFile ( filename, allPuppies );
if ( argc >= 2 ) {
allPuppies.printAll();
}
else {
allPuppies.printOldestPuppy();
}
return 0;
}

(puppies.txt)
Jacky Poodle 12
Bella Beagle 2
Luna Boxer 5
Max Bulldog 6
Shawny Labrador 16
Bailey Terrier 11
Cooper Rottweiler 4
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
