Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

pls use haskell haskell haskell haskell haskell haskell haskell to write the fol

ID: 3603580 • Letter: P

Question

pls use haskell  haskell haskell haskell haskell haskell haskell to write the following code.

Create a function, using partial application of functions, that sees if a single Int is divisible by 5. It takes in an Int and returns a Bool. (edited from original to be a bit easier)

Write a function that checks if every other letter of a string is between 'a' and 'f' (the remaining letters don't matter, start with the first letter in the string, skip the second, and so on). The function takes in a String and returns a Bool. Use partial application at least once. Empty string returns True. (edited to specify what empty string returns, some clarification added).

Write a function that takes two lists, zips them, then maps the result to a list of sums of the numbers in the tuples. E.g., [1, 2, 3] [4, 5, 6] gets zipped to [(1, 4), (2, 5), (3,6)], then gets mapped to [5, 7, 9].

Write a function that maps a list of Strings that may have multiple words to Strings with only the first word left. E.g. ["Today is Thursday", "Banquet", "unreal games"] becomes ["Today", "Banquet", "unreal"].

Write a function that takes a two dimensional matrix of Strings and transforms all empty strings to "0".

Thank you

Explanation / Answer

package com.chegg.test;

public class StringTest {

/**

* @param args

*/

public static void main(String[] args) {

StringTest stringTest = new StringTest();

boolean flag = stringTest.divisibleByFive(6);

System.out.println(flag);

}

private boolean divisibleByFive(int num){

if(num%5==0)

return true;

else

return false;

}

private boolean checkString(String val){

if(val!=null){

if(val.equals("")){

return true;

}else if(val.startsWith("a") && val.endsWith("f"))

return true;

else

return false;

}else

return false;

}

}