Using C++, Write a full class definition for a class named Acc1, containing no constructors, functions, or data members (i.e., a totally empty class). (Note, the last character of the classname is "one" not "ell".)

Respuesta :

Hi!

Okay, so - 

To make a C++ class, we have to use the keyword class followed by the class name, and a pair of curly braces which will be our class body

Our class body is what holds all of our constructors, functions, and data members. 

So, to write a completely empty class - we would just have to simply write:

class Acc1 
{

};

Note -

All classes must end with a semi colon! This is just a standard rule we follow since it was how C++ has been defined. If you were to leave the semi colon out, you would get a compiler error! =)

In C++, the class without constructors, functions or data members is known as empty class. A constructor is a member function of the class that initializes the objects of the class. The constructor is automatically called when object is created.

A function of a class is similar to any other variable that has its definition within the class.

Further Explanation:

Code: Following is the C++ code to create a class named as Acc1 with no constructors, functions or data members i.e. empty class.

//header file for input and output

#include<iostream>

using namespace std;

class Acc1{

};

// main function starts here

int main() {

  Acc1 a1;

  return 0;

}

Learn more:

1. A company that allows you to license software monthly to use online is an example of ? brainly.com/question/10410011  

2. Prediction accuracy of a neural network depends on _______________ and ______________. brainly.com/question/10599832  

3. The shape of our galaxy was determined ‘on the inside looking out' by surveying the milky way using ____________ telescopes. brainly.com/question/7866623

Answer details:

Grade: Senior Secondary School

Subject: Computer Science

Chapter: C++ Programming

Keyword:

Java, input, output, programming, statements, if-else, loops, print, string, while, public, void, static, main, number, C++, C, class, member function, constructor, destructor, variables, data members, empty class, Acc1, class definition, last character, one, ell