#import "/template.typ": *
#show: A => apply(A)
#set raw(lang: "java-new")
#set par(leading: 0.475em)
#assignment(1)[
Write a menu-driven program to implement linear and binary search on an object of a custom array class.
]
#scos("ArraySearch")
=== Discussion
#skind[Classes, interfaces and methods used from Java standard library]
- `void java.util.Arrays.sort(double[])`: A static method facilitating in-place sorting of the provided array.
- `java.util.Scanner` Class:
- Constructor `Scanner(java.io.InputStream)`: Creates a scanner object for scanning values from given input stream.
- Methods `int nextInt()`, `double nextDouble()`: Scan an integer or `double` value from the the input stream.
- `java.util.function.BiFunction<T, U, V>` Interface:
- Objects implementing this interface represent functions taking two arguments of types `T` and `U`, returning a value of type `V`.
- Member method `V apply(T, U)` is used to invoke the underlying function.
- `public static java.io.PrintStream System.out, System.err`: Represents the standard output and error streams.
- `public void java.io.PrintStream.println(String)` and `public void java.io.PrintStream.pri