Learn To Code
Declare an integer variable cardsInHand and initialize it to 13.
LANGUAGE: C++ CHALLENGE: Declare an integer variable cardsInHand and initialize it to 13.
Read MoreWrite a statement that declares and initializes two integer variables.
LANGUAGE: C++ CHALLENGE: Write a statement that declares and initializes two integer variables. Call the first one age and initialize it to 15, and call the second one weight and initialize it to 90.
Read MoreWrite some code that swaps their values. Declare any additional variables as necessary, but do not redeclare firstPlaceWinner and secondPlaceWinner.
LANGUAGE: C++ CHALLENGE: Given two int variables, firstPlaceWinner and secondPlaceWinner, write some code that swaps their values. Declare any additional variables as necessary, but do not redeclare firstPlaceWinner and secondPlaceWinner.
Read Morewrite some code that swaps the values in i and j. Use temp to hold the value of i and then assign j’s value to i.
LANGUAGE: C++ CHALLENGE: Given three already declared int variables, i, j, and temp, write some code that swaps the values in i and j. Use temp to hold the value of i and then assign j’s value to i. The originalvalue of i, which was saved in temp, can now be assigned to j.
Read Morewrite some code that swaps the values in i and j by copying their values to itemp and jtemp, respectively, and then copying itemp and jtemp to j and i, respectively.
LANGUAGE: C++ CHALLENGE: Given two int variables, i and j, which have been declared and initialized, and two other int variables, itemp and jtemp, which have been declared, write some code that swaps the values in i and j by copying their values to itemp and jtemp, respectively, and then copying itemp and jtemp to j and i, respectively.
Read MoreWrite a statement to assign to weight_in_pounds the value of weight_in_kilos times 2.2.
LANGUAGE: C++ CHALLENGE: Write a statement to assign to weight_in_pounds the value of weight_in_kilos times 2.2. (The variables have already been declared and weight_in_kilos has already been initialized .)
Read MoreWrite a statement to add the values of x and y together, storing the result in sum.
LANGUAGE: C++ CHALLENGE: Write a statement to add the values of x and y together, storing the result in sum. (The variables have already been declared and x and y have already been initialized .)
Read MoreWrite a statement to multiply diameter by 3.14159 and assign the result to circumference.
LANGUAGE: C++ CHALLENGE: Write a statement to multiply diameter by 3.14159 and assign the result to circumference. (The variables have already been declared and diameter has already been initialized .)
Read MoreWrite a statement to set the value of area to the value of length times the value of width.
LANGUAGE: C++ CHALLENGE: Write a statement to set the value of area to the value of length times the value of width. (The variables have already been declared and length and width have already been initialized .)
Read MoreWrite a statement to set the value of priceequal to three times the value of cost.
LANGUAGE: C++ CHALLENGE: Write a statement to set the value of priceequal to three times the value of cost.(The variables have already been declared and cost has already been initialized .)
Read MoreWrite a statement to set the value of ansequal to the value of num plus 5.
LANGUAGE: C++ CHALLENGE: Write a statement to set the value of ansequal to the value of num plus 5. (These variables have already been declared and num has already been initialized .)
Read MoreGiven two integer variables matricAge and gradAge, write a statement that gives gradAge a value that is 4 more than the value of matricAge.
LANGUAGE: C++ CHALLENGE: Given two integer variables matricAge and gradAge, write a statement that gives gradAge a value that is 4 more than the value of matricAge.
Read More