Question: There are 10 run-time, compile and code safety problems with the following program. (One of the problems is revealed below as an example of how

There are 10 run-time, compile and code safety problems with the following program.

(One of the problems is revealed below as an example of how to answer this question)

Debug and improve the following program for compilation and run-time errors and also code safety corrections.

Specify each problem by including line number, the type of problem, with a suggested fix. See the example below for the format of answering the question:

An Example to show how to answer this question: Line 13: [1 mark] Compile error, ostream must be returned by reference [2 marks] Fix: ostream& print() [2 marks]

9 mistakes to find, 45 points to collect.

Program to debug:

There are 10 run-time, compile and code safety problems with the following

H #include IN using namespace std; 3 class Paper { 4 public: Paper() { Paper ("") ; ostream write() { cout write()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!