Outdoor Advertising Panels” have the following characteristics:
length–A Constantnumeric value indicating the lengthof the panel in meters.(Defaults to 5 )
width–A numeric value indicating the width of the panel in meters.( Between 2 and 5 inclusively. Defaults to 3 )
height–A numeric value indicating the height of the panel from the ground in meters.(Between 1.5 and 2.8 inclusively. Defaults to 1.5)
location–The name of the citywhere the panel is located.(Maximum of 30 characters.Defaults to Empty String )
panelCount–A commoninformation known toall object of the class. It will be used to hold the number of object created.Thus it should be incremented when an
object is created and decremented when an object is destroyed.(Defaults to 0)
Create class Panelthat will be used by an advertisingcompany to manage its “Outdoor Advertising Panels” Your class should include the following member functions:
A constructor with default arguments.
A“setPanel”functionthat sets all data members of a Panel object. (integrity checks required)
A “getLocation”functions that returns the location data of a Panel object
.
A function that prints to the screen the contents of the data members.(Cascading capabilities required).
A function that calculates the surface of the panel in square meters. (surface=length*width)Your design should include:
An external function“incHeight” that will be used to increase the “height” data member by a certain value
.
This external function should be able to
access by name all members of your class
.
Write a program to test y
our class by creating “advertising panels” objects as following:
Ask the user to enter the number of panels to create.
Dynamically
create the objects for the requested number of panels.
Verify whether the objects creation is successful.
Ask the user to fil
l the data for all created objects.
Finally, print on the screen (using the print member function) the information of all “advertising
Panels” located in the city of
Beirut
[code]
#include <iostream>
#include <cstring>
using namespace std;
class Panel
{
private:
const int lenght;
int width;
double height;
char loc[30];
static int count;
public:
Panel(int,int,double,char[]);
void printall();
char getlocation(char loc []);
int main()
{
cout<<"Enter the number of Panel to create:";
int s;
cin>>s;
Panel * x;
x=new Panel[s];
cout<<"The Number of Panel Created is :"<<s<<endl;
}
now i'm condused i dont know anymore what i have done and what is still missing and if i have any logic errors
/*
Outdoor Advertising Panels” have the following characteristics:
* length – A Constant numeric value indicating the length of the panel in meters.(Defaults to 5 )
* width – A numeric value indicating the width of the panel in meters.( Between 2 and 5 inclusively. Defaults to 3 )
* height – A numeric value indicating the height of the panel from the ground in meters.(Between 1.5 and 2.8 inclusively. Defaults to 1.5)
* location – The name of the citywhere the panel is located.(Maximum of 30 characters.Defaults to Empty String )
* panelCount – A commoninformation known toall object of the class. It will be used to hold the number of object created.Thus it should be incremented when an
object is created and decremented when an object is destroyed.(Defaults to 0)
Create class Panel that will be used by an advertisingcompany to manage its “Outdoor Advertising Panels”
Your class should include the following member functions:
* A constructor with default arguments.
* A “setPanel” function that sets all data members of a Panel object.
(integrity checks required)
* A “getLocation”functions that returns the location data of a Panel object
* A function that prints to the screen the contents of the data members.
(Cascading capabilities required).
* A function that calculates the surface of the panel in square meters.
(surface=length*width)
Your design should include:
* An external function“incHeight” that will be used to increase the “height”
data member by a certain value
This external function should be able to
access by name all members of your class
*/
dear thomas I still have some questions
first the string getLocation how do we write the function ?? and can it be char instead of string because we didn't learn the string..
And the getSurface function what is it for ??