Hello there, I have a problem with this:
I get:Code:#include <iostream>
#include <string>
class Monitor
{
class Panel
{
public:
Panel (int initialPrice);
~Panel();
// The GetFunction() section
int GetPrice() const { return itsPrice; }
void GetModel() const { std::cout << itsModel; }
int GetBrightness() const { return itsBrightness; }
int GetContrast() const { return itsContrast; }
int GetTimeResponse() const { return itsTimeResponse; }
void GetMaxRes() const { std::cout << itsMaxRes; }
// The SetFunctions()
int SetPrice(int price) { itsPrice = price; }
void SetModel(std::string model) { itsModel = model; }
int SetBrightness(int brightness) { itsBrightness = brightness; }
int SetContrast(int contrast) { itsContrast = contrast; }
int SetTimeResponse(int timeResponse) { itsTimeResponse = timeResponse; }
int SetMaxRes(int maxRes) { itsMaxRes = maxRes; }
private:
int itsPrice;
std::string itsModel;
int itsBrightness;
int itsContrast;
int itsTimeResponse;
int itsMaxRes;
};
class Frequency
{
public:
// The GetFunctions
int GetHFreq()const { return itsHFreq; }
int GetVFreq()const { return itsVFreq; }
// The SetFunctions
int SetHFreq(int HFreq) { itsHFreq = HFreq; }
int SetVFreq(int VFreq) { itsVFreq = VFreq; }
private:
int itsHFreq;
int itsVFreq;
};
};
Monitor::Panel::Panel(int initialPrice) { itsPrice = initialPrice; }
Monitor::Panel::~Panel() {}
int main()
{
// Set the Values
Monitor Samsung;
Samsung.Panel.SetPrice(350);
return 0;
}
int main()':
7 line `class Monitor::Panel' is private
63 line within this context
63 line invalid use of `class Monitor::Panel'
What I have to do that it can fix this error ? What I am doing wrong ?