Assume that the supermarket class contains an instance variable named storage whose type is double. Write a constructor for this class that initializes the storage to 2300.00
Code
In java
class supermarket
{
private double storage;
public supermarket()
{
storage=2300.00;
}
}
in c++
class supermarket
{
public:
supermarket()
{
storage=2300.00;
}
private:
double storage;
};
If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.
Get Answers For Free
Most questions answered within 1 hours.