Category: Visual Basic

Given an integer variable n that has been initialized to a positive value and,in addition,Integer variables k and total that have already been declared,use a For loop to compute the sum of the cubes of the first n whole numbers, and store this value in total. Use no variables other than n,k, and total.

Given an integer variable n that has been initialized to a positive value and,in addition,Integer variables k and total that have already been declared,use a For loop to compute the sum of the cubes of the first n whole numbers, and store this value in total. Use no variables other than n,k, and total.

LANGUAGE: Visual Basic CHALLENGE: Given an integer variable n that has been initialized to a positive value and,in addition,Integer variables k and total that have already been declared,use a For loop to compute the sum of the cubes of the first n whole numbers, and store this value in total. Use no variables other than n,k,...

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Given int variables k and total that have already been declared, use a for loop to compute the sum of the squares of the first 50 whole numbers, and store this value in total. Thus your code should put 1*1 + 2*2 + 3*3 + … + 49*49 + 50*50 into total. Use no variables other than k and total.

Given int variables k and total that have already been declared, use a for loop to compute the sum of the squares of the first 50 whole numbers, and store this value in total.  Thus your code should put 1*1 + 2*2 + 3*3 + … + 49*49 + 50*50 into total.  Use no variables other than k and total.

LANGUAGE: Visual Basic CHALLENGE: Given int variables k and total that have already been declared, use a for loop to compute the sum of the squares of the first 50 whole numbers, and store this value in total. Thus your code should put 1*1 + 2*2 + 3*3 + … + 49*49 + 50*50 into total....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Assume the integer variables counter, low, high, and result have been declared and that low and high have been initialized. Write a For loop that adds the integers between low and high (inclusive), and stores the result in result. Your code should not change the values of low and high. Also, do not declare any additional variables — use only counter, low, high and result.

Assume the integer variables counter, low, high, and result have been declared and that low and high have been initialized.  Write a For loop that adds the integers between low and high (inclusive), and stores the result in result.  Your code should not change the values of low and high.  Also, do not declare any additional variables — use only counter, low, high and result.

LANGUAGE: Visual Basic CHALLENGE: Assume the integer variables counter, low, high, and result have been declared and that low and high have been initialized. Write a For loop that adds the integers between low and high (inclusive), and stores the result in result. Your code should not change the values of low and high. Also, do...

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Assume the integer variables counter, low, high, and result have been declared and that low and high have been initialized. Write a For loop that adds the integers between low and high (inclusive), and stores the result in result. Your code should not change the values of low and high. Also, do not declare any additional variables — use only counter, low, high and result.

Assume the integer variables counter, low, high, and result have been declared and that low and high have been initialized.  Write a For loop that adds the integers between low and high (inclusive), and stores the result in result.  Your code should not change the values of low and high.  Also, do not declare any additional variables — use only counter, low, high and result.

LANGUAGE: Visual Basic CHALLENGE: Assume the integer variables counter,low, high, and result have been declared and that low and high have been initialized. Write a For loop that adds the integers between low and high (inclusive), and stores the result in result. Your code should not change the values of low and high. Also, do not...

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Given an int variable k that has already been declared use a for loop to print a single line consisting of 97 asterisks. Use no variables other than k.

Given an int variable k that has already been declared use a for loop to print a single line consisting of 97 asterisks.  Use no variables other than k.

LANGUAGE: Visual Basic CHALLENGE: Given an int variable k that has already been declared use a for loop to print a single line consisting of 97 asterisks. Use no variables other than k....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Give that two Integer variables, total and amount have been declared, write a loop that reads non-negative values into amount and adds them into total. The loop terminates when a value less than 0 is read into amount. Don’t forget to initialize total to 0. To read a value into amount use a method, getNum() that we provide for you a class named tC: amount = TC.getNum();

Give that two Integer variables, total and amount have been declared, write a loop that reads non-negative values into amount and adds them into total. The loop terminates when a value less than 0 is read into amount. Don’t forget to initialize total to 0.   To read a value into amount use a method, getNum() that we provide for you a class named tC:  amount = TC.getNum();

LANGUAGE: Visual Basic CHALLENGE: Give that two Integer variables, total and amount have been declared, write a loop that reads non-negative values into amount and adds them into total. The loop terminates when a value less than 0 is read into amount. Don’t forget to initialize total to 0. To read a value into amount use...

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Assume the int variables i, lo, hi and result have been declared and that lo and hi have been initialized. Assume further that result has been initialized to the value 0. Write a for loop that adds the integers between lo and hi (inclusive), and stores the result in result. Your code should not change the values of lo and hi. Also, do not declare any additional variables — use only i, lo, hi, and result.

Assume the int variables i, lo, hi and result have been declared and that lo and hi have been initialized. Assume further that result has been initialized to the value 0. Write a for loop that adds the integers between lo and hi (inclusive), and stores the result in result. Your code should not change the values of lo and hi.   Also, do not declare any additional variables — use only i, lo, hi, and result.

LANGUAGE: Visual Basic CHALLENGE: Assume the int variables i, lo, hi and result have been declared and that lo and hi have been initialized. Assume further that result has been initialized to the value 0. Write a for loop that adds the integers between lo and hi (inclusive), and stores the result in result. Your code...

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Assume that an array of integers named a has been declared and initialized. Write a single statement that assigns a new value to the first element of the array. The new value should be equal to twice the value stored in the last element of the array.

Assume that an array of integers named a has been declared and initialized.  Write a single statement that assigns a new value to the first element of the array.  The new value should be equal to twice the value stored in the last element of the array.

LANGUAGE: Visual Basic CHALLENGE: Assume that an array of integers named a has been declared and initialized. Write a single statement that assigns a new value to the first element of the array. The new value should be equal to twice the value stored in the last element of the array....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Assume that an array of Integers named a that contains exactly five elements has been declared and initialized. In addition, an Integer variable j has also been declared and initialized to a value somewhere between 0 and 3. Write a single statement that assigns a new value to the element of the array indexed by j. This new value should be equal to twice the value stored in the next element of the array (i.e. the element after the element indexed by j).

Assume that an array of Integers named a that contains exactly five elements has been declared and initialized.  In addition, an Integer variable j has also been declared and initialized to a value somewhere between 0 and 3.  Write a single statement that assigns a new value to the element of the array indexed by j.  This new value should be equal to twice the value stored in the next element of the array (i.e. the element after the element indexed by j).

LANGUAGE: Visual Basic CHALLENGE: Assume that an array of Integers named a that contains exactly five elements has been declared and initialized. In addition, an Integer variable j has also been declared and initialized to a value somewhere between 0 and 3. Write a single statement that assigns a new value to the element of the...

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

An array of Integers named a has been declared with 12 elements. The integer variable k holds a value between 2 and 8. Assign 22 to the element just before a[k].

An array of Integers named a has been declared with 12 elements.  The integer variable k holds a value between 2 and 8.  Assign 22 to the element just before a[k].

LANGUAGE: Visual Basic CHALLENGE: An array of Integers named a has been declared with 12 elements. The integer variable k holds a value between 2 and 8. Assign 22 to the element just before a[k]....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

An array of Integers named a has been declared with 12 elements. The integer variable k holds a value between 0 and 6. Assign 9 to the element just after a[k].

An array of Integers named a has been declared with 12 elements.  The integer variable k holds a value between 0 and 6.  Assign 9 to the element just after a[k].

LANGUAGE: Visual Basic CHALLENGE: An array of Integers named a has been declared with 12 elements. The integer variable k holds a value between 0 and 6. Assign 9 to the element just after a[k]....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Given that an array named a whose elements are of type Integer has been declared, assign the value -1 to the last element in a.

Given that an array named a whose elements are of type Integer has been declared, assign the value -1 to the last element in a.

LANGUAGE: Visual Basic CHALLENGE: Given that an array named a whose elements are of type Integer has been declared, assign the value -1 to the last element in a....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More