Question

Part t True er Fahe ( pts each) Tue or false? true F or fase -C++8 generally regarded as a low-level language. Given x S, y 3, the exprossion (x<y)&& ((y > 0) 11 (y-= x + 2)) istrue hh writing computer pograms, its best practice to write all your functions and the entire pogram, befbre testing any one of the functions or program segments by itself Operators have inputs and return outputs. When an arthmetie operator has been overloaded as a menber, in the additieon of objects B, the operand on the left side (A) of the plus sign is the calling objeet An o fs trean object must be declaresd to write tiom a C++ program to a file A file does not to be opened before reading tom it When overloading an operator, you have the ability to change the traditional behavior of the operator, for example making the + operator do things that feel like multiplication, but this is not generally recommended. When you make a function a friend of a class, the Friend functions has access to the clasas private members -Class Destructors are used to free memory once an object is no longer needed. When Designing a class, a Constructor is not needed Aray Indexes always start at zero

0 0
Add a comment Improve this question Transcribed image text
Answer #1
  1. C++ is generally regarded as a low level language.

Answer: FALSE

Though C++ is developed using the fundamentals of ‘C’ programming Language which is a Low Level Language, It is additionally most importantly have Object Oriented Programming (OOP’s) principle which are mainly used in developing the mobile, desktop applications.

So C++ is not a Low level language it is a High Level Programming language.

Answer: TRUE

As x and y values negative numbers, these two integer variables are stored in computer memory in 2’s compliment. The 2’s compliments of ‘x’ and ‘y’ are:

X = 1111 1111 1111 1011

Y = 1111 1111 1111 1101

Firstly, as per the precedence and associativity rule, ((y>0) || ( y ==x+2 )) will be evaluated.

Eventhough Y>0 is FALSE, Y == X+2 will be TRUE. So as a result Entire Expression is TRUE.

Next , (x<y) will be evaluated and this condition also TRUE.

So as a result Entire Expression is TRUE.

        3.

                Answer: TRUE

                It is best practice to write all the functions before testing. This makes the testing easy.

        4.

                Answer: TRUE

                Yes operators too take the input has parameters and returns the result of the expression.

              Example:

                                int x=6,y=7;

                                x=x+y; // Here addition operator as inputs x, y and it returns result of x, y variables.

         5.

                Answer: TRUE

               The object to the left side of the plus sign that is in case of

                A + B ; expression ‘A’ is the calling object.

      6.

                Answer: TRUE

                Inorder to write to a file in C++ program it is mandatory to create an object for ofstream class.

      7.

                Answer: FALSE

In order to read from the file it is mandatory to open a file using fopen() library function, this is because to read from file we have to use fread() library function for which we have to pass the File descriptor of fopen() library function.                               

      8.

                Answer: TRUE

Even though we can change the particular operator function body i.e, inside + operator function we can do division and multiplication other operations, it is not advisable or recommended.

     9.

                Answer: TRUE

The purpose and main intension of the Friend function is to access the private data of a class outside of it i.e, can be in other functions and classes.

    10.

                Answer: FALSE

                The Destructor is called automatically only when the program terminates. The purpose of the    class destructor is used to deallocate the memory which was allocated by the Constructor.

     11.

                Answer: FALSE

Though it is not mandatory to have a constructor when we are designing a class but it is highly recommended to define a constructor. This is because as part of the complex designs we may requires to use copy and parameterized constructors in that scenario it is must to define a Default constructor for each class.

      12.

                Answer: TRUE

Yes, array index always starts with zero. This is to ensure that array name indicates the starting address of the array.

Example:

int arr[3] ={ 1, 2, 3};

Here, arr is an array name. When we print the value of ‘’arr[0]’’ or ‘’(arr+0)’’ we will get the first value of the array i.e, 1.

Add a comment
Know the answer?
Add Answer to:
Part t True er Fahe ( pts each) Tue or false? true F or fase -C++8...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT