HTML and CSS Reference
In-Depth Information
return n * factorial(n-1);
}
}
7. Write a function that returns the total cost of any number of buckets of paint.
Ask the user how many buckets he or she is going to buy and for the cost of one
bucket. Ask the user the color of the paint. Calculate and return what he or she
owes. Change the color of the font to the color of the paint. Use the
catch/try/throw statements to check for invalid input if the user doesn't give you
a valid value for the number of buckets, such as a number less than 0, or gives
you no input, or types in a string, and so on, check that the user doesn't give
you a color of paint that is the same color as the background of your document
or you will not be able to see the color of the font.
Search WWH ::




Custom Search