1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Anna [14]
3 years ago
10

. Constructors can / cannot (circle correct choice) be called explicitly as if they were regular member functions.

Computers and Technology
1 answer:
Sunny_sXe [5.5K]3 years ago
3 0

Answer:

Constructor can be called as explicitly, when the compiler create the nameless and temporary object and then it get immediately get destroyed. As constructor is the special type of function which typically creates the instance of class.

The special member function in the constructor can be called as explicitly by the programmer. The main purpose of the constructor is initializing the object of the class while executing the code in the method for performing various task.

You might be interested in
Assume that speed = 10 and miles = 5. What is the value of each of the
Assoli18 [71]

a. speed + 12 - miles * 2  = 10 + 12 - 5 * 2. With order of operations, we do the multiplication first so the equation is now 10 + 12 - 10 = 22 - 10 = 12

b. speed + miles * 3  = 10 + 5 * 3 and again, order of operations gives us 10 + 15 = 25

c. (speed + miles) * 3  = (10 + 5) * 3 = 15 * 3 = 45

d. speed + speed * miles + miles  = 10 + 10 * 5 + 5 = 10 + 50 + 5 = 60 + 5 = 65

e. (10 – speed) + miles / miles = (10 - 10) + 5 / 5 = 0 + 5 / 5 = 5 / 5 = 1

5 0
3 years ago
Write the name of test for the given scenario. Justify your answer.
Snowcat [4.5K]

Answer:

Cevap b okey xx

Explanation:

Sinyorrr

8 0
3 years ago
A(n) ________ variable is declared inside a module and cannot be accessed by statements that are outside the module.
Advocard [28]
Local






----------------------------------------------------
6 0
3 years ago
A method countDigits(int num) of class Digits returns the remainder when the input argument num(num > 0) is divided by the nu
sertanlavr [38]

Answer:

#include <iostream>

using namespace std;

class Digits

{

   public:

   int num;

   int read()       //method to read num from user

   {

       cout<<"Enter number(>0)\n";

       cin>>num;

       return num;

   }

   int digit_count(int num)  //method to count number of digits of num

   {

       int count=0;

       while(num>0)    //loop till num>0

       {

           num/=10;

           count++;   //counter which counts number of digits

       }

       return count;

   }

   int countDigits(int num)   //method to return remainder

   {

       int c=digit_count(num); //calls method inside method

       return num%c;  

   }

};

int main()

{

   Digits d;    //object of class Digits is created

   int number=d.read();   //num is read from user

   cout<<"\nRemainder is : "<<d.countDigits(number);  //used to find remainder

   return 0;

}

Output :

Enter number(>0)

343

Remainder is : 1

Explanation:

As program is missing to find errors , a logically write program is written to find the remainder when a number is divided by its number of digits. A class  Digits is constructed which has public variable num and methods read(), digit_count(), countDigits().

  • read() - This method reads value of num from the user and return num.
  • digit_count() - This method takes a integer as parameter and counts the number of digits of a number passed as argument. while loop is used to increement the counter until num<0. This returns the value of count.
  • countDigits() - This method takes a integer as a parameter and returns remainder when the argument is divided by number of  digits of argument. Number of digits is calculated by using method digit_count().

At last in main method , object of Digits class is created and its methods are used to find the output.

7 0
3 years ago
Write a function named power that accepts two parameters containing integer values (x and n, in that order) and recursively calc
lianna [129]

Answer:

Following are the code to the given question:

int power(int x, int n)//defining a method power that accepts two integer parameters

{

if (n == 0)//defining if block to check n equal to 0

{

return 1; //return value 1

}

else//defining else block

{

x = x * power(x, --n); //use x variable to call method recursively

}

return x; //return x value

}

Explanation:

In the above-given code, a method power is defined that accepts two integer variable in its parameter, in the method a conditional statement is used which can be defined as follows:

  • In the if block, it checks "n" value, which is equal to 0. if the condition is true it will return value 1.
  • In the else block, an integer variable x is defined that calls the method recursively and return x value.
8 0
3 years ago
Other questions:
  • When you divide a picture into thirds, how many parts do you end up with? *
    14·2 answers
  • What are the primary functions of motor oil? a. Reduce friction and prevent wear b. Keep engine surfaces clean c. Remove heat to
    11·1 answer
  • Which option is most likely used to create many-to-many relationships in Access?
    8·1 answer
  • What is the output <br>this is a computer science question ​
    8·1 answer
  • Suppose the fixed width of an aside element in a fixed layout is 300 pixels, and the fixed width of its parent element (body) is
    15·1 answer
  • When reading words using a Scanner object's next method, _________. a. any characters at the beginning of the input that are con
    5·1 answer
  • What is application software? A computer language for accessing data in a database. A character string used to identify the loca
    10·1 answer
  • A gui allows you to interact with objects on the screen such as icons and buttons true or false
    7·1 answer
  • After creating a webpage with html code, what do you need to do so that others can access it on the internet?.
    11·1 answer
  • Select all the correct answers.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!