Answered step by step
Verified Expert Solution
Question
1 Approved Answer
// Directions: Implement the following methods // // MI..!!! // Goal - understand using Static classes - i.e. the Math class was not designed to
// Directions: Implement the following methods // // MI..!!! // Goal - understand using Static classes - i.e. the Math class was not designed to be instantiated (make objects) // It is a class that provides functionality and will be used to complete one of the methods import java.lang. Math; public class Lab2Exercises { // computes area of a hexagon when given its side public static int areaOfAHexagon(double a) { //TODO } // computes perimeter of a hexagon when given its side public static int perimeterOfAHexagon(double a) { //TODO } // Returns the count of character that are vowels in the given String // Also print the given string in lowercase. // We suggest using built-in String methods (not a loop). // https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html public static int countVowels(String str) { //TODO } // Use a Scanner to reads a number (integer) that is exactly 5 digits long and print it in reverse // for example: 12304 will be printed as 40321. Your solution doesn't need to work for numbers ending in zero(es) // or numbers that aren't exactly 5 digits long. // Use a Scanner to reads a number (integer) that is exactly 5 digits long and print it in reverse // for example: 12304 will be printed as 40321. Your solution doesn't need to work for numbers ending in zero(es) // or numbers that aren't exactly 5 digits long. // You MUST use divide and/or modulus operators and may save part of the number, then concatenate back // together as a String and return it. public static String reverse5DigitNumber(double usrNumber) { //TODO } // test client public static void main(String[] args) { //TODO: Modify to test all methods from above. // Use Scanner to read inputs from user. Don't use Scanner inside above functions
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started