Chapter 6 Methods 233 e) (Web hosting packages) x = Math.Abs(
Chapter 6 Methods 233 e) x = Math.Abs( -6.4 ); f) x = Math.Ceiling( -6.4 ); g) x = Math.Ceiling( -Math.Abs( -8 + Math.Floor( -5.5 ) ) ); 6.8 A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write a program that calculates and displays the parking charges for each customer who parked a car in this garage yesterday. You should enter in a TextBox the hours parked for each customer. The program should display the charge for the current customer. The program should use the method CalculateCharges to determine the charge for each customer. Use the techniques described in the chapter to read the double value from a TextBox. 6.9 Write a method IntegerPower( base,exponent ) that returns the value of base exponent For example, IntegerPower(3,4 ) = 3* 3*3 *3. Assume that exponent is a positive, nonzero integer, and base is an integer. Method IntegerPower should use for or while to control the calculation. Do not use any Math library methods. Incorporate this method into a Windows application that reads integer values from TextBoxes for base and exponent from the user and performs the calculation with the IntegerPower method. 6.10 Define a method Hypotenuse that calculates the length of the hypotenuse of a right triangle when the other two sides are given. The method should take two arguments of type doubleand return the hypotenuse as a double. Incorporate this method into a Windows application that reads integer values for side1 and side2 from TextBoxes and performs the calculation with the Hypotenuse method. Determine the length of the hypotenuse for each of the following triangles: Triangle Side 1 Side 2 1 3.0 4.0 2 5.0 12.0 3 8.0 15.0 6.11 Write a method SquareOfAsterisksthat displays a solid square of asterisks whose side is specified in integer parameter side. For example, if sideis 4, the method displays **** **** **** **** Incorporate this method into an application that reads an integer value for side from the user and performs the drawing with the SquareOfAsterisks method. This method should gather data from Textboxes and should print to a label. 6.12 Modify the method created in Exercise 6.11 to form the square out of whatever character is contained in character parameter fillCharacter. Thus, if side is 5 and fillCharacteris #, this method should print ##### ##### ##### ##### #####
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.