Lab 3 Course: CSE165 Solved

40.00 $

Category: Tags: , , ,

Description

5/5 - (1 vote)

All the exercises below are selected from the textbook: Thinking in C++ (volume 1).

1. [Exercise-6 on Page 326] Modify the Handle.h, Handle.cpp, and UseHandle.cpp files at the end of Chapter 5 to use  constructors and destructors. [20 points]

2. [Exercise-1 on Page 349] Create a Text class that contains a string object to hold the text of a file. Give it two  constructors: a default constructor and a constructor that takes a string argument that is the name of the file to  open. When the second constructor is used, open the file and read the contents into the string member object. Add  a member function contents() to return the strings so (for example) it can be printed. In main(), open a file using  Text and print the contents. [45 points]

3. [Exercise-25 on Page 508] Create a class containing an array of int. Index through  this array using a pointer to  member. [35 points]

Requirements:

* Usage of spaces, blank lines, indention, and comments for readability

* Descriptive names of variables, functions, structs, classes, and objects (if any)

* Appropriate usage of structs, classes, and objects (if any)

Penalties:

* Zero if you have possession of a copy of online solutions or work done by someone else.

* 5-point deduction per day late

 

  • Lab-3-3hqs1q.zip