#include #include #include using namespace std; struct Book { string title; string author; int pages; float hoursToRead; }; void estimateReadingTime(Book *p, float readingSpeed); // Function declaration int main() { Book myBook {"Oliver Twist", "Charles Dickens", 608, 0.0}; float speed = 40.0; // Pages per hour estimateReadingTime(&myBook, speed); // Pass address of the book to the function return EXIT_SUCCESS; } void estimateReadingTime(Book *p, float readingSpeed) { if (readingSpeed <= 0) { cout << "Invalid reading speed.\n"; return; } p->hoursToRead = p->pages / readingSpeed; cout << "At " << readingSpeed << " pages per hour, it will take about " << p->hoursToRead << " hours to read \"" << p->title << "\" by " << p->author << ".\n"; }