Create a program for Android Patient Tracker app
### Functional Interfaces and Lambda Expressions
------------------------------------------------
Use the below classpublic class LambdaSample { private static List<String> names=new ArrayList<>();
private static Map<String,String> studentDetails;
static {
names=Arrays.asList( "Anju","Raju","Arun","Vikram"); studentDetails=new HashMap<String,String>();
studentDetails.put("Anju","Delhi");
studentDetails.put("Raju","Chennai");
studentDetails.put("Arun","Delhi");
}
}Implement below static methods and access them from main method . Use Java8 functions1. displayNames()
--should displayall the names 2. findByName(String name)
-- check whether the given name exists in the list3. getAllcount()
-- count the number of person whose name starts with "A"4. getStduentData()
-- use biconsumer and print the student details5. showMaxlength()
-- display the list of names which is length to be 4 charactersGiven a list of strings, find the list of strings which start with letter I in the given strings using Predicate Functional Interface
This exercise contains a class named PredicateFunctionalInterface with the following method:
+findPattern(List) : List
-Should accept list of strings as input
-Should find the list of strings which start with letter I in the given strings
-Should return list of strings which start with letter I in the given strings as output
-Should return empty list if no such string is found which start with letter I
-Should avoid the redundancy among the strings in output
Example
Sample Input:
[Icecream,Water,Ice,Gas,Ice]
Expected Output:
[Icecream,Ice]
Sample Input:
[Java,C,C++,Java,C]
Expected Output:
[]
Sample Input:
[]
Expected Output:
[]
Create a program with three methods/functions, The first one takes in n which is the size of an array then creates and populate the array with student names, the second method takes in n which is the size of an array then creates and populate n by 3 array with student marks(The three marks are for test 1 - 3) and finally a method that takes in the two arrays, calculates the final mark of all test and print out the results as indicated below: The first method should return and array of names and the second should return an array all test marks(i.e. 2d array with 3 columns). The third method in addition should also return an array for all the final marks
Name Test 01 Test 02 Test 03 Final
-------- --------- --------- --------- ---------
Gerry 55 55 55 55
Sample Test 1:
Enter the total number of students:
1
Enter name:
koko
Enter mark for Test 1:
78
Enter mark for Test 2:
65
Enter mark for Test 3:
70
Name Test01 Test02 Test03 Final
------ ------ ------ ------ -----
koko 78 65 70 71
Create a program with a method that takes a single character and returns true if the character is a vowel otherwise return false.
Write a java program that accepts a given n, then create a 2D array with n rows and n columns. Then for each cell the value should be n+row to the power column. For example if we talk of n=5, then array[0][0] =(5+0)0 = 1. Print out all the values in the array created.
Traversing a Sorted Linear Array
Inserting Item into Sorted Linear Array
insertItem()
Get value of ITEM to be inserted.
Call findLocationInsert()
findLocationInsert()
Search for position which ITEM can be inserted and Return position
Deleting item into Sorted Linear Array
deleteItem()
Get value of ITEM to be deleted
Call findLocationDelete()
findLocationDelete()
Search for the position in which ITEM will be deleted and return position
main() - Display option similar to this:
1. Insert value 2. Delete value 3. Traverse array 4. Exit
Provide switch statement which cases for the shown options are written.
array must be checked if it's already full or not.
Enter your choice: 1
Enter element to inserted: 5
Array Basic Operations
1. Insert a value
2. Delete a value
3. Traverse the array
4. Exit
Enter your choice: 1
Enter element to inserted: 3
Array Basic Operations
1. Insert value
2. Delete value
3. Traverse array
4. Exit
Enter your choice: 3
The elements of the array: 3 5
How to add items with details such as Product Name, Quantity, Image, Expiry Date (from date picker) to another activity upon clicking the add button.
Write a java program that accepts a given n, then create a 2D array with n rows and n columns. Then for each cell the value should be n+row to the power column. For example if we talk of n=5, then array[0][0] =(5+0)0 = 1. Print out all the values in the array created.
Using the above code add a method that takes in three arrays, one for student names, one for final test marks and a last one for assignment mark. The method should then calculate the students qualifying mark (a student needs 50 or more to qualify) using the following weights: 40% of the test and 60% of the assignment, finally print out whether the person qualified or not. [10]
Use the below format for you print out:
Name Test Assignment Final Examination
-------- ------- ---------------- ------- ------------------
King 59 85 75 Allowed
John 52 45 48 Denied
Sample Test 1:
Enter the total number of students:
3
Enter name:
koko
Enter name:
jojo
Enter name:
momo
Enter mark for Test 1:
78
Enter mark for Test 2:
65
Enter mark for Test 3:
70
Enter mark for Test 1:
55
Enter mark for Test 2:
56
Enter mark for Test 3:
89
Enter mark for Test 1:
45
Enter mark for Test 2:
25
Enter mark for Test 3:
38
Enter assignment Mark:
66
Enter assignment Mark:
86
Enter assignment Mark:
70