Can anyone help me with this. this is java and it is called API practice lab it is for school and i am confused

2022.01.26 18:18 Sharp_News3249 Can anyone help me with this. this is java and it is called API practice lab it is for school and i am confused

  1. Method hypotenuse(double a, double b)Recall from your studies in mathematics that a right triangle has two perpendicular sides connected to a third side, typically referred to as the hypotenuse. The Pythagorean Theorem states that the relationship between the first two sides, a and b, and the hypotenuse, c, is a2 + b2 = c2. This hypotenuse method accepts values for the right sides of a triangle, a and b, as arguments. Square these two values, add them, and then return the square root of the sum using the Math.pow() and Math.sqrt() methods. Do not use multiplication, and do not use the Math.hypot() method.
  2. Methods max(double a, double b) and min(double a, double b) These methods accept two double values and return the largest or smallest of the two. No special Math or String methods are needed.
  3. Methods max(String a, String b) and min(String a, String b) These methods accept two String values and return the lexicographically bigger or smaller of the two. You will need a String method here.
  4. Method isSameText(String a, String b) This method compares strings a and b to see if they contain the same text. A String method may be needed here.
  5. Method getLongestString(String a, String b, String c) This method compares the number of characters in each string rather than their lexicographic qualities. How do you determine how many characters there are in a string? Since there are three strings to compare, this method is slightly more challenging.
  6. Method getShortestString(List list) The list may contain zero or more strings. Your task is to find the string in the list with the fewest characters. If the incoming list is null or contains zero strings, return null from this method. Otherwise, you will need to loop through the list to find the smallest string. This task will require the use of methods from both the List interface and the String class.
  7. Methods getStringBeforeComma(String s) and getStringAfterComma(String s) These methods expect a string that has a comma somewhere inside of it. Your task will be to correctly provide the text leading up to the comma, as well as the text after the comma, but not the comma itself. This will require at least two methods from the String class.

this is the code I need to solve
import java.util.ArrayList;

public class ApiPracticeRunner {
public static void main(String\[\] args) { print("hypotenuse(3, 4)", ApiPractice.hypotenuse(3, 4), 5.0); print("max(-3, 1)", ApiPractice.max(-3, 1), 1); print("max(40, 40)", ApiPractice.max(40, 40), 40); print("max(4, 10)", ApiPractice.max(4, 10), 10); print("min(-3, 1)", ApiPractice.min(-3, 1), -3); print("min(40, 40)", ApiPractice.min(40, 40), 40); print("min(4, 10)", ApiPractice.min(4, 10), 4); print("max(\\"cat\\", \\"dog\\")", ApiPractice.max("cat", "dog"), "dog"); print("max(\\"Cat\\", \\"dog\\")", ApiPractice.max("cat", "Dog"), "cat"); print("min(\\"cat\\", \\"dog\\")", ApiPractice.min("cat", "dog"), "cat"); print("min(\\"Cat\\", \\"dog\\")", ApiPractice.min("cat", "Dog"), "Dog"); String str1 = "cat"; String str2 = new String("cat"); String str3 = "Cat"; print("isSameText(str1, str2)", ApiPractice.isSameText(str1, str2), true); print("isSameText(str1, str3)", ApiPractice.isSameText(str1, str3), false); String a = "abc"; String b = "abcd"; String c = "ab"; String d = "wxyz"; print("getLongestString(a, b, c)", ApiPractice.getLongestString(a, b, c), b); print("getLongestString(a, b, d)", ApiPractice.getLongestString(a, b, d), b); ArrayList stringList = new ArrayList(); stringList.add("abcde"); stringList.add("abc"); stringList.add("xyz"); stringList.add("jklm"); print("getShortestString(stringList)", ApiPractice.getShortestString(stringList), "abc"); ArrayList stringList2 = new ArrayList(); print("getShortestString(\*empty list\*)", ApiPractice.getShortestString(stringList2), null); String commaString = "Once upon a time, there lived a cat."; print("getStringBeforeComma(commaString)", ApiPractice.getStringBeforeComma(commaString), "Once upon a time"); print("getStringAfterComma(commaString)", ApiPractice.getStringAfterComma(commaString), " there lived a cat."); } private static void print(String methodCall, double result, double expected) { System.out.print("Result of " + methodCall + ": \[" + result + "\] "); if (result == expected) System.out.println("Good!"); else System.out.println("Incorrect. Expected \[" + expected + "\]"); } 

private static void print(String methodCall, String result, String expected) { System.out.print("Result of " + methodCall + ": \[" + result + "\] "); if ((result == null && expected == null) || 
result.equals(expected)) System.out.println("Good!");
 else System.out.println("Incorrect. Expected \[" + expected + "\]"); } private static void print(String methodCall, boolean result, boolean expected) { System.out.print("Result of " + methodCall + ": \[" + result + "\] "); if (result == expected) System.out.println("Good!"); else System.out.println("Incorrect. Expected \[" + expected + "\]"); } 

private static void printBlankLine() { System.out.println(); } 
}





and this what I put the codes in

import java.util.List;

public class ApiPractice {
/**
* Finds the hypotenuse of a right triangle given sides a and b.
* u/param a Length of side a.
* u/param b Length of side b.
* u/return Length of hypotenuse.
*/
public static double hypotenuse(double a, double b) {
/* Add code here. Fix placeholder return statement. */
return -1;
}
/**
* Returns the greater of two values. If the values are exactly the same,
* it returns one of them.
* u/param a First value.
* u/param b Second value.
* u/return Largest value.
*/
public static double max(double a, double b) {
/* Add code here. Fix placeholder return statement. */
return -1;
}
/**
* Returns the smaller of two values. If the values are exactly the same,
* it returns one of them.
* u/param a First value.
* u/param b Second value.
* u/return Smallest value.
*/
public static double min(double a, double b) {
/* Add code here. Fix placeholder return statement. */
return -1;
}

/**
* Returns the lexicographically greater of two strings. If the values are
* exactly the same, it returns one of them.
* u/param a First string.
* u/param b Second string.
* u/return Lexicographically greatest string.
*/
public static String max(String a, String b) {
/* Add code here. Fix placeholder return statement. */
return "unknown";
}
/**
* Returns the lexicographically lesser of two strings. If the values are
* exactly the same, it returns one of them.
* u/param a First string.
* u/param b Second string.
* u/return Lexicographically lesser string.
*/
public static String min(String a, String b) {
/* Add code here. Fix placeholder return statement. */
return "unknown";
}
/**
* Compares two strings to see if they contain the same text.
* u/param a First string.
* u/param b Second string.
* u/return true if the strings contain the same text,
* false otherwise.
*/
public static boolean isSameText(String a, String b) {
/* Add code here. Fix placeholder return statement. */
return false;
}
/**
* Returns the longest string (the string with the greatest number of
* characters) out of three strings. If two or more strings have the same
* number of characters, it returns the first one.
* u/param a First string.
* u/param b Second string.
* u/param c Third string.
* u/return String with the fewest characters.
*/
public static String getLongestString(String a, String b, String c) {
if (a.length()>b.length()&& a.length() >c.length())
return a;
if (b.length()>a.length()&& b.length() >c.length())
return b;
if (c.length()>a.length()&& c.length() >b.length())
return c;
if (a.length()==b.length())
return a;
if (a.length()==c.length())
return a;
if (b.length()==c.length())
return b;
return a;
}
/**
* Returns the shortest string (the string with the lowest number of
* characters) from a list of strings. If two or more strings have the
* same number of characters, it returns the first one.
*
* If the incoming list is null or contains zero strings,
* this method returns null.
*
* u/param list List of incoming strings.
* u/return String with the fewest characters.
*/
public static String getShortestString(List list) {
/* Add code here. Fix placeholder return statement. */
return "unknown";
}
/**
* Returns a substring of the incoming string that contains all of the
* characters leading up to, but not including, the comma found
* in the string.
* u/param s A string with a comma somewhere inside of it.
* u/return The substring leading up to the comma.
*/
public static String getStringBeforeComma(String s) {
/* Add code here. Fix placeholder return statement. */
return "unknown";
}
/**
* Returns a substring of the incoming string that contains all of the
* characters after the comma found inside the string.
* u/param s A string with a comma somewhere inside of it.
* u/return The substring after the comma.
*/
public static String getStringAfterComma(String s) {
/* Add code here. Fix placeholder return statement. */
return "unknown";
}
}
submitted by Sharp_News3249 to computers [link] [comments]


2022.01.26 18:18 skyeyemx I said hi to google assistant and she was so nice I can't even-

I said hi to google assistant and she was so nice I can't even- submitted by skyeyemx to teenagers [link] [comments]


2022.01.26 18:18 Travaran Kaguya Love is War Tribute「AMV」

I'm pretty new to editing so sorry for how scuffed this looks XD hope you enjoy
submitted by Travaran to AnimeAmv [link] [comments]


2022.01.26 18:18 Jambroni99 [Identification]

[Identification] submitted by Jambroni99 to Watches [link] [comments]


2022.01.26 18:18 Nohan07 Le militant socialiste, Ludovic Martheli, a tiré sa révérence à 89 ans

Le militant socialiste, Ludovic Martheli, a tiré sa révérence à 89 ans submitted by Nohan07 to martiniqueisland [link] [comments]


2022.01.26 18:18 Andromeda660 Anyone have a crack for Clip Studio Paint?

Every website seems to have malware on them
submitted by Andromeda660 to CrackSupport [link] [comments]


2022.01.26 18:18 treees93 Alright mommies, I need this answered after todays episode. I’ve been seeing a woman and I really like her… but we hooked up for the first time recently and her meow smelled so badly. Like left an aroma on my hands & body bad (after multiple washes? How do I address this? Do I address this?? Help

submitted by treees93 to yourmomshousepodcast [link] [comments]


2022.01.26 18:18 -plants-for-hire- Analysis: Gibraltar picked 100% in NA ALGS Playoffs but 3% in casual play. A look at legend popularity in Apex

Analysis: Gibraltar picked 100% in NA ALGS Playoffs but 3% in casual play. A look at legend popularity in Apex submitted by -plants-for-hire- to CompetitiveApex [link] [comments]


2022.01.26 18:18 sararsmitty Max and moriah

Does anyone know if Max and Moriah are still together? I don’t see him in any pics with her anymore.
submitted by sararsmitty to plathville [link] [comments]


2022.01.26 18:18 kevo32 [USA-WI] [H] 5700 XT, RX 470, EVGA SuperNova 550 GA Gold 550W [W] Paypal

XFX 5700 XT THICC III $775 shipped Comes with original box, average day to day use for past 2 years, no mining. - https://i.imgur.com/SeSm4Jm.jpg
ASUS ROG STRIX RX 470 $175 shipped No mining, been sitting in closet for 2 years - https://i.imgur.com/Pk1UqRb.jpg
BNIB SEALED EVGA SuperNOVA 550 GA, 80 Plus Gold 550W $50 shipped
submitted by kevo32 to hardwareswap [link] [comments]


2022.01.26 18:18 Junior121197 24M looking for a nice girl to talk to

Well, I will say little here, the rest will be in the chat :) I can talk about anything; What I like: I really like movies, I also watch some TV series, I like video games, I like to travel, I like astronomy (although I'm a layman hehe)... I'm also starting to get into the habit of reading , so we can talk about books too. I to say that I talk a lot, so don't think it's weird if I send several messages in the chat haha, sometimes I can't control it and I talk a lot at once. So shall we chat?
submitted by Junior121197 to MakeNewFriendsHere [link] [comments]


2022.01.26 18:18 Majestic-Football-82 Gente ¿Que es lo más interesante que han visto durante un viaje astral?:

submitted by Majestic-Football-82 to AskRedditespanol [link] [comments]


2022.01.26 18:18 KenzotuberKZ-YT Insanely funny race between 2 kids!

Insanely funny race between 2 kids! submitted by KenzotuberKZ-YT to KidsAreFuckingEvil [link] [comments]


2022.01.26 18:18 vulgarbitch444 been in the works for a little while now

been in the works for a little while now submitted by vulgarbitch444 to graffhelp [link] [comments]


2022.01.26 18:18 swordmaster997 need CICO reassurance!

Hi !! Ok so I’ve been counting my calories and keeping a record on them for 3 months now.. thing is I did a very strict diet that the hunger and cravings have come back and since i’m a very active person now i get super hungry. I have a question tho according to many websites and calculations the amount of calories that i should consume per week is a total of around 17,500 so i need some reassurance: if I eat less than that every week no matter what food i’m eating am i losing weight? Like truly?? Thank you :( I’m very stressed about this
submitted by swordmaster997 to CICO [link] [comments]


2022.01.26 18:18 dragonekm Why do i hate myself in an angry way, and not a sad way like i did past couple months?

it sounds dumb, but for the past 8 months or so i hated myself in a i wanna kms/extremely sad way, for the past couple weeks i am completely angry over myself, over what i do etc. in an angry and frustrated way, and not a sad and depressive way and idk whys that. i do not know how can i expand it further or if you can even make sense of what im saying.
submitted by dragonekm to mentalhealth [link] [comments]


2022.01.26 18:18 LuminTheFray I coin this, "Deck sticker shock"

I coin this, submitted by LuminTheFray to masterduel [link] [comments]


2022.01.26 18:18 yvesvelvet Are people with uni requirements of like 3A*s actually confident they’ll get that?

I really want to go to my firm uni with the offer I have of ABB with A in epq but i doubt myself so much, even though I’m predicted higher than that I don’t think I’m capable, I cant imagine the stress of having to get an A*. Everyone on this sub seems so chill with getting such high grades
submitted by yvesvelvet to 6thForm [link] [comments]


2022.01.26 18:18 DocShotgunBE This man send someone after me, asked him why and this was his what he said. It’s interactions like this why i play RDO

This man send someone after me, asked him why and this was his what he said. It’s interactions like this why i play RDO submitted by DocShotgunBE to RedDeadOnline [link] [comments]


2022.01.26 18:18 ElectivireMax '36 Roosevelt vs '72 Nixon vs '64 Johnson vs '84 Reagan

'36 Roosevelt vs '72 Nixon vs '64 Johnson vs '84 Reagan submitted by ElectivireMax to YAPms [link] [comments]


2022.01.26 18:18 MarcusAvouris @infinitumx_ : Bitcoin is energy intensive because establishing the truth is energy intensive. Higher the energy cost, higher confidence in the facts the resulting work established (ledger).

@infinitumx_ : Bitcoin is energy intensive because establishing the truth is energy intensive. Higher the energy cost, higher confidence in the facts the resulting work established (ledger). submitted by MarcusAvouris to infinitumX [link] [comments]


2022.01.26 18:18 Ghost-of-Chap82 Feature film with the star of Succession puts Riverland town on the map

Feature film with the star of Succession puts Riverland town on the map submitted by Ghost-of-Chap82 to southaustralia [link] [comments]


2022.01.26 18:18 CreativeMind1999 Georgia Hassarati (Too Hot to Handle Show)

Georgia Hassarati (Too Hot to Handle Show) submitted by CreativeMind1999 to VindictaRateCelebs [link] [comments]


2022.01.26 18:18 TheActualSauceboss Need some help with KUI nameplates and combo points

Need some help with KUI nameplates and combo points Any1 know how to get animal charged combo points to show on target (I'm using KUI nameplates)
I know there is a weakaura to show it anywhere on the screen but I would love to just use KUI if possible. Thanks in advance :P
https://preview.redd.it/0s7gdue3m3e81.png?width=811&format=png&auto=webp&s=bbdd30132cde84be0a53dfe469ecdab8ac054264
submitted by TheActualSauceboss to worldofpvp [link] [comments]


2022.01.26 18:18 Wosvo 3D Unicorn That I made years ago in Blender.

3D Unicorn That I made years ago in Blender. submitted by Wosvo to bladerunner [link] [comments]


http://amk77.ru