Visual Basic
Given an Integer variable n that has already been declared and initialized to a positive value, use a While loop to print a single line consisting of n asterisks. Use no variables other than n.
LANGUAGE: Visual Basic CHALLENGE: Given an Integer variable n that has already been declared and initialized to a positive value,use a While loop to print a single line consisting of n asterisks. Use no variables other than n.
Read MoreGiven an integer variable k that has already been declared, use a While loop to print a single line consisting of 88 asterisks. Use no variables other than k.
LANGUAGE: Visual Basic CHALLENGE: Given an integer variable k that has already been declared,use a While loop to print a single line consisting of 88 asterisks. Use no variables other than k.
Read MoreGiven int variables k and total that have already been declared, use a Do…Loop While 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 Do…Loop While 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.…
Read MoreWrite a statement that increments the value of the int variable total by the value of the int variable amount. That is, add the value of amount to total and assign the result to total.
LANGUAGE: Visual Basic CHALLENGE: Write a statement that increments the value of the int variable total by the value of the int variable amount. That is, add the value of amount to total and assign the result to total.
Read MoreGiven an int variable n that has already been declared and initialized to a positive value, use a Do…Loop While loop to print a single line consisting of n asterisks. Use no variables other than n.
LANGUAGE: Visual Basic CHALLENGE: Given an int variable n that has already been declared and initialized to a positive value, use a Do…Loop While loop to print a single line consisting of n asterisks. Use no variables other than n.
Read MoreGiven an Integer variable k that has already been declared, use a Do…Loop While loop to print a single line consisting of 53 asterisks. Use no variables other than k.
LANGUAGE: Visual Basic CHALLENGE: Given an Integer variable k that has already been declared,use a Do…Loop While loop to print a single line consisting of 53 asterisks. Use no variables other than k.
Read MoreGive 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 termiantes when a value less tha 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 termiantes when a value less tha 0 is read into amount. Don’t forget to initialize total to 0. To read a value into amount use a…
Read MoreAssume 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…
Read MoreGiven an integer variable n that has been initialized to a positvie 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 positvie 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…
Read MoreGiven 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 counting 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 counting 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…
Read MoreAssume the int variables i, lo, hi and result have been declared and that lo and hi have been initialized. 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. 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…
Read MoreGiven an int variable n that has been initialzied to a positive value and, in addition, int variables k and total that have already been declared, use a do…while loop to compute the sum of the cubes of the first n whole numbersx, and store this value in total. Use no variables other than n, k, and total.
LANGUAGE: Visual Basic CHALLENGE: Given an int variable n that has been initialzied to a positive value and,in addition,int variables k and total that have already been declared,use a do…while loop to compute the sum of the cubes of the first n whole numbersx, and store this value in total. Use no variables other than n,…
Read More