Reference no: EM132385208
CSE 1321L Programming and Problem Solving Lab Assignment, Kennesaw State University, USA
Lab - Methods
Exercise 1: Design and implement a program (name it MinMaxAvg) that defines three methods as follows:
Method max (int x, int y, int z) returns the maximum value of three integer values.
Method min (int X, int y, int z) returns the minimum value of three integer values.
Method average (int x, int y, int z) returns the average of three integer values.
In the main method, test all three methods with different input value read from the user. Document your code and properly label the input prompts and the outputs as shown in attached file.
Exercise 2: Design and implement a program (name it ComputeAreas) that defines four methods as follows:
Method squareArea (double side) returns the area of a square.
Method rectangleArea (double width, double length) returns the area of a rectangle.
Method circleArea (double radius) returns the area of a circle.
Method triangleArea (double base, double height) returns the area of a triangle.
In the main method, test all methods with different input value read from the user. Document your code and properly label the input prompts and the outputs as shown in attached file.
Exercise 3: Design and implement a program (name it PalindromeInteger), to check if an integer value is a palindrome or not, using 2 methods (reverse and isPalindrome) specified as follows:
Method reverse(int number) takes integer number and returns number in reverse order. The method mathematically reverses the number.
Method isPalindrome(int number) takes integer number and returns true if the number is palindrome; false otherwise.
Use method reverse() to implement method isPalindrome(). Notice that an integer value is palindrome if the value and its reverse are equal.
In the main method, prompt the user to enter an integer value and the program should display proper judgment whether the input value is palindrome or not. Document your code and properly label the input prompts and the outputs as shown in attached file.
Instructions:
1. Programs must be working correctly.
2. Programs must be completed and checked before working the assignment.
3. Programs must be checked by the end of the designated lab session.
Attachment:- Programming and Problem Solving Assignment File.rar