Category: Visual Basic

Write the definition of a function named quadratic that receives three double parameters a,b,c. If the value of a is 0 then the function prints the message “no solution for a=0” and returns. If the value of “b squared” – 4ac is negative, then the code prints out the message “no real solutions” and returns. Otherwise the function prints out the largest solution to the quadratic equation. The formula for the solutions to this equation can be found here: Quadratic Equation of Wikipedia.

Write the definition of a function named quadratic that receives three double parameters a,b,c.  If the value of a is 0 then the function prints the message “no solution for a=0” and returns.  If the value of “b squared” – 4ac is negative, then the code prints out the message “no real solutions” and returns.  Otherwise the function prints out the largest solution to the quadratic equation.  The formula for the solutions to this equation can be found here:  Quadratic Equation of Wikipedia.

LANGUAGE: Visual Basic CHALLENGE: Write the definition of a function named quadratic that receives three double parameters a,b,c.   If the value of a is 0 then the function prints the message “no solution for a=0” and returns.   If the value of “b squared” – 4ac is negative, then the code prints out the message “no […]

Read More

Write an if/else statement that compares the variable age with 65, adds 1 to the variable seniorCitizens if age is greater than or equal to 65, and adds 1 to the variable nonSeniors otherwise.

Write an if/else statement that compares the variable age with 65, adds 1 to the variable seniorCitizens if age is greater than or equal to 65, and adds 1 to the variable nonSeniors otherwise.

LANGUAGE: Visual Basic CHALLENGE: Write an if/else statement that compares the variable age with 65, adds 1 to the variable seniorCitizens if age is greater than or equal to 65, and adds 1 to the variable nonSeniors otherwise.

Read More

Write an if/else statement that compares the value of the variables soldYesterday and soldToday, and based upon that comparison assigns salesTrend the value -1 or 1. -1 represents the case where soldYesterday is greater than soldToday; 1 represents the case where soldYesterday is not greater than soldToday.

Write an if/else statement that compares the value of the variables soldYesterday and soldToday, and based upon that comparison assigns salesTrend the value -1 or 1.  -1 represents the case where soldYesterday is greater than soldToday; 1 represents the case where soldYesterday is not greater than soldToday.

LANGUAGE: Visual Basic CHALLENGE: Write an if/else statement that compares the value of the variables soldYesterday and soldToday, and based upon that comparison assigns salesTrend the value -1 or 1. -1 represents the case where soldYesterday is greater than soldToday; 1 represents the case where soldYesterday is not greater than soldToday.

Read More

Assume a text box named textBox from which data will be read.

Assume a text box named textBox from which data will be read.

LANGUAGE: Visual Basic CHALLENGE: Note: in mathematics, division by zero is undefined. Assume a text box named textBox from which data will be read. Given a int variable named callsReceived and another int variable named operatorsOnCall write the necessary code to read values into callsReceived and operatorsOnCall and print out the number of calls received per […]

Read More