Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement the automobile.cpp class below Automobile.hpp #pragma once #include #include class Automobile { friend bool operator==( const Automobile& lhs, const Automobile& rhs ); friend std::ostream

Implement the automobile.cpp class below

Automobile.hpp

#pragma once
#include
#include
class Automobile {
friend bool operator==( const Automobile& lhs, const Automobile& rhs );
friend std::ostream & operator<<( std::ostream& stream, const Automobile& vehicle );
private:
std::string color_;
std::string brand_;
std::string model_;
std::string plateNumber_;
public:
Automobile( const std::string & color,
const std::string & brand,
const std::string & model,
const std::string & plateNumber );
};
bool operator!=( const Automobile& lhs, const Automobile& rhs );

Automobile.cpp

#include
#include
#include "Automobile.hpp"
/*******************************************************************************
** Member function definitions
*******************************************************************************/
Automobile::Automobile( const std::string & color,
const std::string & brand,
const std::string & model,
const std::string & plateNumber )
: color_(color), brand_(brand), model_(model), plateNumber_(plateNumber)
{}
/*******************************************************************************
** Non-member function definitions
*******************************************************************************/
bool operator==( const Automobile& lhs, const Automobile& rhs ) {
/// To be completed:
/// Return true if each attribute of the left hand side (lhs) is
/// equal to the right hand side (rhs)
. . .
///
}
bool operator!=( const Automobile& lhs, const Automobile& rhs )
{ return !( lhs == rhs ); }
std::ostream & operator<<( std::ostream& stream, const Automobile& vehicle )
{
/// To be completed:
/// Insert the vehicle's color, brand, model, and license plate number into the stream, then return the stream
. . .
///
}

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

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions

Question

politeness and modesty, as well as indirectness;

Answered: 1 week ago