Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I don't understand why it's printing the coordinate (7, 10) twice, it's only supposed to print it once. Please take a look at my functions

I don't understand why it's printing the coordinate (7, 10) twice, it's only supposed to print it once. Please take a look at my functions and help.

image text in transcribed

image text in transcribed

image text in transcribed

Test function with expected input/outputs:

image text in transcribed

My program results:

image text in transcribed

// One parameter constructor. Points2D(const std:: array& item) { size_ = item.size(); sequence_ = new std:: array[size_]; for(int i = 0; i > size_of_sequence; // Allocate space for sequence. size__ size_of_sequence; sequence_ = new std::array[size_]; Object token; for (int i = 0 ; input_stream >> token; i++) { // Read coordinates. // Fill sequence_ here. sequence_[i][0] = token; input_stream >> token; sequence_[i][1] = token; } } // Overloading the operator. friend std::ostream &operator *sequence_; // Size of the sequence. size_t size_; void TestPart1() { Points2D a, b; // Two empty Points2D are created. cout a_point2d{{7, 10}}; Points2D d{a_point2d}; // A Points2D containing (7, 10) should be created. cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions