Category: Visual Basic

An array of integers named parking Tickets has been declared and initialized to the number of parking tickets given out by the city police each day since the beginning of the current year. (Thus, the first element of the array contains the number of tickets given on January 1; the last element contains the number of tickets given today.) A variable named mostTickets has been declared, along with a variable k. Without using any additional variables, write some code that results in mostTickets containing the largest value found in parkingTickets.

An array of integers named parking Tickets has been declared and initialized to the number of parking tickets given out by the city police each day since the beginning of the current year.  (Thus, the first element of the array contains the number of tickets given on January 1; the last element contains the number of tickets given today.)  A variable named mostTickets has been declared, along with a variable k.  Without using any additional variables, write some code that results in mostTickets containing the largest value found in parkingTickets.

LANGUAGE: Visual Basic CHALLENGE: An array of integers named parking Tickets has been declared and initialized to the number of parking tickets given out by the city police each day since the beginning of the current year. (Thus, the first element of the array contains the number of tickets given on January 1; the last element...

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 Integer variable k, an Integer array incompletes that has been declared and initialized, an int variable studenID that has been initialized, and an int variable numberOfIncompletes, write code that counts the number of times the value of studentID appears in incompletes and assigns this value to numberOfIncompletes. You may use only k, incompletes, studentID, and numberOfIncompletes.

Given an Integer variable k, an Integer array incompletes that has been declared and initialized, an int variable studenID that has been initialized, and an int variable numberOfIncompletes, write code that counts the number of times the value of studentID appears in incompletes and assigns this value to numberOfIncompletes.  You may use only k, incompletes, studentID, and numberOfIncompletes.

LANGUAGE: Visual Basic CHALLENGE: Given an Integer variable k, an Integer array incompletes that has been declared and initialized, an int variable studenID that has been initialized, and an int variable numberOfIncompletes, write code that counts the number of times the value of studentID appears in incompletes and assigns this value to numberOfIncompletes. You may 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

You are given two Integer variables j and k, an Integer array zipcodeList that has been declared and initialized, and a Boolean variable duplicates. Write some code that assigns True to duplicates if any two elements in the array have the same value, and that assigns False to duplicates otherwise. Use only j, k, zipcodeList, and duplicates.

You are given two Integer variables j and k, an Integer array zipcodeList that has been declared and initialized, and a Boolean variable duplicates.  Write some code that assigns True to duplicates if any two elements in the array have the same value, and that assigns False to duplicates otherwise.  Use only j, k, zipcodeList, and duplicates.

LANGUAGE: Visual Basic CHALLENGE: You are given two Integer variables j and k, an Integer array zipcodeList that has been declared and initialized, and a Boolean variable duplicates. Write some code that assigns True to duplicates if any two elements in the array have the same value, and that assigns False to duplicates otherwise. Use only...

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

You are given an Integer variable k, an Integer array zipcodeList that has been declared and initialized, and a Boolean Variable duplicates. Write some code that assigns True to duplicates if there are two adjacent elements in the array that have the same value, and that assigns False to duplicates otherwise. Use only k, zipcodeList, and duplicates.

You are given an Integer variable k, an Integer array zipcodeList that has been declared and initialized, and a Boolean Variable duplicates.  Write some code that assigns True to duplicates if there are two adjacent elements in the array that have the same value, and that assigns False to duplicates otherwise.  Use only k, zipcodeList, and duplicates.

LANGUAGE: Visual Basic CHALLENGE: You are given an Integer variable k, an Integer array zipcodeList that has been declared and initialized, and a Boolean Variable duplicates. Write some code that assigns True to duplicates if there are two adjacent elements in the array that have the same value, and that assigns False to duplicates otherwise. 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

Given an Integer variable k, an Integer array currentMembers that has been declared and initialized, an Integer variable memberID that has been initialized, and a Boolean variable isAMember, write code that assigns True to isAMember if the value of memberID can be found in currentMembers, and that assigns false to isAMember otherwise. Use only k, currentMembers, memberID and isAMember.

Given an Integer variable k, an Integer array currentMembers that has been declared and initialized, an Integer variable memberID that has been initialized, and a Boolean variable isAMember, write code that assigns True to isAMember if the value of memberID can be found in currentMembers, and that assigns false to isAMember otherwise.  Use only k, currentMembers, memberID and isAMember.

LANGUAGE: Visual Basic CHALLENGE: Given an Integer variable k, an Integer array currentMembers that has been declared and initialized, an Integer variable memberID that has been initialized, and a Boolean variable isAMember, write code that assigns True to isAMember if the value of memberID can be found in currentMembers, and that assigns false to isAMember otherwise....

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

Reversing the elements of an array involves swapping the corresponding elements of the array: the first with the last, the second with the next to last, and so on, all the way to the middle of the array. Given an array a and two other Integer variables, k and temp, write a loop that reverses the elements of the array. Do not use any other variables besides a, k, and temp.

Reversing the elements of an array involves swapping the corresponding elements of the array:  the first with the last, the second with the next to last, and so on, all the way to the middle of the array.  Given an array a and two other Integer variables, k and temp, write a loop that reverses the elements of the array.  Do not use any other variables besides a, k, and temp.

LANGUAGE: Visual Basic CHALLENGE: Reversing the elements of an array involves swapping the corresponding elements of the array: the first with the last, the second with the next to last, and so on, all the way to the middle of the array. Given an array a and two other Integer variables, k and temp, write 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

Given an array temps of Doubles, containing temperature data, compute the average temperature. Store the average in a variable called avgTemp. Besides temps and avgTemp, you may use only two other variables — an Integer variable k and a Double variable named total, which have been declared.

Given an array temps of Doubles, containing temperature data, compute the average temperature.  Store the average in a variable called avgTemp.  Besides temps and avgTemp, you may use only two other variables — an Integer variable k and a Double variable named total, which have been declared.

LANGUAGE: Visual Basic CHALLENGE: Given an array temps of Doubles, containing temperature data, compute the average temperature. Store the average in a variable called avgTemp. Besides temps and avgTemp, you may use only two other variables — an Integer variable k and a Double variable named total, which have been declared....

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 s is a string variable that is supposed to contain a value to be converted to integer. Write a fragment of code that converts the value to integer variable and displays that value multiplied by 2. If the value cannot be converted, display the message ‘Invalid number’ instead.

Assume that s is a string variable that is supposed to contain a value to be converted to integer.  Write a fragment of code that converts the value to integer variable and displays that value multiplied by 2.  If the value cannot be converted, display the message ‘Invalid number’ instead.

LANGUAGE: Visual Basic CHALLENGE: Assume that s is a string variable that is supposed to contain a value to be converted to integer. Write a fragment of code that converts the value to integer variable and displays that value multiplied by 2. If the value cannot be converted, display the message ‘Invalid number’ instead....

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

Write the code for a message whose method name is send Object.  There is one argument for this message, which is of type Customer.  Suppose there is an object of type Customer, called John_Doe.  Send this object within your message.

Write the code for a message whose method name is send Object.  There is one argument for this message, which is of type Customer.  Suppose there is an object of type Customer, called John_Doe.  Send this object within your message.

LANGUAGE: Visual Basic CHALLENGE: Write the code for a message whose method name is send Object.   There is one argument for this message, which is of type Customer.   Suppose there is an object of type Customer, called John_Doe.   Send this object within your message....

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

Write the code for a message whose method is send Two.  There are two arguments for this message: a double and an int.  Send the Double value of 15.955 and the Integer value of 133 in the message.

Write the code for a message whose method is send Two.  There are two arguments for this message: a double and an int.  Send the Double value of 15.955 and the Integer value of 133 in the message.

LANGUAGE: Visual Basic CHALLENGE:  Write the code for a message whose method is send Two. There are two arguments for this message: a double and an int. Send the Double value of 15.955 and the Integer value of 133 in the message....

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

 print Larger is a function that accepts two int parameters and returns no value.  Two int variables, sales 1 and sales 2, have already been declared and initialized.  Write a statement that calls printLarger, passing it sales1 and sales2.

 print Larger is a function that accepts two int parameters and returns no value.  Two int variables, sales 1 and sales 2, have already been declared and initialized.  Write a statement that calls printLarger, passing it sales1 and sales2.

LANGUAGE: Visual Basic CHALLENGE:  print Larger is a function that accepts two int parameters and returns no value.   Two int variables, sales 1 and sales 2, have already been declared and initialized.   Write a statement that calls printLarger, passing it sales1 and sales2....

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

Write the code for a message whose method name is send Variable. There is one argument for this message, which is an int. Suppose an int variable called x has been declared and initialized to some value. Send this variable in your message.

Write the code for a message whose method name is send Variable.  There is one argument for this message, which is an int.  Suppose an int variable called x has been declared and initialized to some value.  Send this variable in your message.

LANGUAGE: Visual Basic CHALLENGE: Write the code for a message whose method name is send Variable. There is one argument for this message, which is an int.   Suppose an int variable called x has been declared and initialized to some value.   Send this variable in your message....

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