Uncategorized

The declaration

Consider the following statement: int* p, q; This statement could lead to what type of misinterpretation? (2) Suppose that you have the declaration int *numPtr;. What is the difference between the expressions *numPtr and &numPtr? (3) What is the output of the following C++ code? (2, 3) int int1 = 26; int int2 = 45; […]

The declaration Read More »

The desired result

The following code is intended to find the area and perimeter of a rectangle. However, it fails to do so. Provide the correct code to accomplish the desired result. Also, do not modify the numeric values assigned to the variables in the code. After correcting the code, what is the output?   (2, 3, 6) double

The desired result Read More »

Cloudy

Given the following statements: int num; int *numPtr; write C++ statements that use the variable numPtr to increment the value of the variable num. (2, 3) What is the output of the following C++ code? (2, 3) string str1 = “sunny”; string str2 = “cloudy”; string *s1; cout < str1=””>< “=”” “=””>< str2=””><> s1 =

Cloudy Read More »

Code executes

What is the output of the following code? (2, 3, 6) int *myPtr = new int; int *yourPtr; *myPtr = 15; yourPtr = new int; delete myPtr; myPtr = yourPtr; *yourPtr = 28; myPtr = new int; *myPtr = 49; *yourPtr = 34; delete yourPtr; yourPtr = myPtr; myPtr = new int; *myPtr = 54;

Code executes Read More »

Syntax errors

The following code has syntax errors. Provide the correct code and the output. (2, 3, 6) int *speed = new int; //Line 1 double *travelTime; //Line 2 double *distance; //Line 3 &speed = 65; //Line 4 *travelTime = 8.5; //Line 5 distance = new double; //Line 6 distance = (*speed) * (*travelTime); //Line 7 cout

Syntax errors Read More »

The output

What is the output of the following C++ code? (2, 3, 6) int *myPtr = new int; int *yourPtr = new int; *myPtr = 10; *yourPtr = 2 * *myPtr + 3; cout < *myptr=””>< “=”” “=””>< (*yourptr=”” -=”” *myptr=”” +=”” 5)=””><> myPtr = yourPtr; yourPtr = new int; *yourPtr = 8; cout < *myptr=””><

The output Read More »

The memory

What is the output of the following code? (8) int *intArrayPtr; int *temp; intArrayPtr = new int[5]; *intArrayPtr = 7; temp = intArrayPtr; for (int i = 1; i < 5;=”” i++)=””>     intArrayPtr++;     *intArrayPtr = *(intArrayPtr – 1) 1 2 * i; intArrayPtr = temp; for (int i = 0; i < 5;=””

The memory Read More »

WhatsApp
Hello! Need help with your assignments?

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

🛡️ Worried About Plagiarism? Run a Free Turnitin Check Today!
Get peace of mind with a 100% AI-Free Report and expert editing assistance.

X