Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// Directions: Implement the following methods // // MI..!!! // Goal - understand using Static classes - i.e. the Math class was not designed to

image text in transcribedimage text in transcribed

// 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

More Books

Students also viewed these Databases questions

Question

Refer to Problem 10-1. What is the projects PI?

Answered: 1 week ago

Question

3. Is IBMs program really a mentoring program? Why or why not?

Answered: 1 week ago