CJCoding With Joseph
15free / daySign inCreate account

Seneca BTP 305

Welcome to BTP 305 Lab 2

Lab 2

In this folder, you will find the patrial walkthrough and explanation for this lab.

It is very important that you read each page carefully and write out the code yourself. Do not copy and paste. The goal is to build real understanding and muscle memory by typing everything out on your own.

Below, you’ll find the complete lab instructions and the main tester file you’ll be using for this lab.


Learning Outcomes

Upon successful completion of this exercise, you will have demonstrated the abilities to:

  • retrieve records from a text file using an input file stream object

  • count the number of records in a text file

  • monitor the time spent on a particular task using the std::chrono library

  • implement copy semantics for a class with a resource

  • implement move semantics for a class with a resource

  • identify the processing-intensive operations in copy and move assignments

Compiling and Testing Your Program

All your code should be compiled using this command on matrix:

/usr/local/gcc/10.2.0/bin/g++ -Wall -std=c++17 -g -o ws file1.cpp file2.cpp ...
  • -Wall: compiler will report all warnings

  • -std=c++17: the code will be compiled using the C++17 standard

  • -g: the executable file will contain debugging symbols, allowing valgrind to create better reports

  • -o ws: the compiled application will be named ws

After compiling and testing your code, run your program as following to check for possible memory leaks (assuming your executable name is ws):

Members only

Keep reading this lesson

You've reached the end of the free preview. Unlock the rest of this lesson plus 17 more lessons in Seneca BTP 305.

  • Unlimited coding questions
  • Unlimited access to all classroom material
  • Weekly live call for questions and guidance
  • 3,000 AI tutor tokens / month
  • Personal SQL database (3 MB)
  • Progress tracking

Cancel any time.