CSC134-01 Java Prof. Lamma Exam 2 Name: 1. When would you use a For loop instead of a While loop? 2. Why can’t you do this statement to compare two strings? If (stringA == stringB) 3. What is the...

Just do number 5


CSC134-01 JavaProf. Lamma Exam 2 Name: 1. When would you use a For loop instead of a While loop? 2. Why can’t you do this statement to compare two strings? If (stringA == stringB) 3. What is the difference between a while and a do while loop? 4. When would you use the switch/case statement instead of an if statement? 5. You are asked to write a program to determine what the cost is to fill a pool with water: a. Prompt the user for the following (values entered must be at least the number in parentheses): i. Length of pool in feet (25) ii. Width of pool in feet (10) iii. Average depth of pool (5) b. Given that there are 7.5 gallons per cubic foot, calculate and display the number of gallons required to fill the pool. c. The price per gallon of water is 35 cents per gallon for the first 10,000 gallons, 50 cents per gallon after the first 10,000 gallons. Calculate and display the total cost to fill the pool with water.
Mar 14, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here