Skip to content

TanzeelaFatima492/robert-lafore-cpp-chapter3

Repository files navigation

Robert Lafore C++ Chapter 3 – Exercise Solutions

This repository contains solutions to selected exercises from Chapter 3: Functions and References of the book
📘 "Object-Oriented Programming in C++" by Robert Lafore.

📚 Solved Exercises

Exercise No. Description
Exercise 1 Basic function to display a line
Exercise 2 Function to display multiple lines
Exercise 4 Function to convert inches to feet
Exercise 5 Return-by-value in temperature conversion
Exercise 6 Use of global variables in functions
Exercise 7 Function returning larger of two numbers
Exercise 8 Demonstrating function prototypes
Exercise 12 Using function overloading

📌 All code is written in standard C++ and can be compiled using any modern compiler like g++, clang++, or MSVC.

🚀 How to Compile and Run

To compile and run an example (e.g., exercise1.cpp), use the following command:

g++ exercise1.cpp -o exercise1
./exercise1

📁 Folder Structure

robert-lafore-cpp-chapter3/
├── exercise1.cpp
├── exercise2.cpp
├── exercise4.cpp
├── exercise5.cpp
├── exercise6.cpp
├── exercise7.cpp
├── exercise8.cpp
├── exercise12.cpp
└── README.md

✅ About the Book

This book is a classic for beginners to intermediate programmers looking to master object-oriented concepts through C++. Chapter 3 focuses on:

  • Function declaration & definition
  • Return values
  • Parameter passing
  • Overloading and more

🙋‍♀️ Author

Tanzeela Fatima 📍 Kotli AJK 🔗 GitHub Profile 📧 [email protected]


Feel free to fork or star the repo if you find it helpful!

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published