Using Visual Studio Code, create a program in the language of your choice that: Requests the user to enter a number bet
Posted: Fri May 20, 2022 3:15 pm
Using Visual Studio Code, create a program in the language of
your choice that:
Requests the user to enter a number between 1 and 10
Creates an array containing the numbers 19, 85, and 2.
Loops three times (a single loop that runs three times):
the first run of the loop will multiply the number entered by
the first element of the array (19).
the second run of the loop will subtract the second element of
the array (85) from the result of the first calculation.
the third run of the loop will divide the result of the second
calculation by the third element of the array (2).
If the result is greater than the number originally entered,
then display the message "Your result is greater than X" - with "X"
being the number originally entered.
If the result is less than the number originally entered, then
display the message "Your result is less than X" - with "X" being
the number originally entered.
If the result is equal to the number originally entered, then
display the message "Your result is equal to X" - with "X" being
the number originally entered.
Make sure that your program works as expected.
your choice that:
Requests the user to enter a number between 1 and 10
Creates an array containing the numbers 19, 85, and 2.
Loops three times (a single loop that runs three times):
the first run of the loop will multiply the number entered by
the first element of the array (19).
the second run of the loop will subtract the second element of
the array (85) from the result of the first calculation.
the third run of the loop will divide the result of the second
calculation by the third element of the array (2).
If the result is greater than the number originally entered,
then display the message "Your result is greater than X" - with "X"
being the number originally entered.
If the result is less than the number originally entered, then
display the message "Your result is less than X" - with "X" being
the number originally entered.
If the result is equal to the number originally entered, then
display the message "Your result is equal to X" - with "X" being
the number originally entered.
Make sure that your program works as expected.