Answer:
/*
Find Largest and Smallest Number in an Array Example
This Java Example shows how to find largest and smallest number in an
array.
*/
public class FindLargestSmallestNumber {
public static void main(String[] args) {
//array of 10 numbers
int numbers[] = new int[]{32,43,53,54,32,65,63,98,43,23};
//assign first element of an array to largest and smallest
int smallest = numbers[0];
int largetst = numbers[0];
for(int i=1; i< numbers.length; i++)
{
if(numbers[i] > largetst)
largetst = numbers[i];
else if (numbers[i] < smallest)
smallest = numbers[i];
}
System.out.println("Largest Number is : " + largetst);
System.out.println("Smallest Number is : " + smallest);
}
}
/*
Output of this program would be
Largest Number is : 98
Smallest Number is : 23
*/
Explanation:
Answer:b)Reserve Room, Enter Contact Information, Enter Reservation Detail
Explanation: The use case is described as actors , actors goal, usage of use cases, units of scope and initial point and terminating point of use cases .
The situation mentioned in the question will take place for the reservation of the room through the instances in the form like filling the contact details for the identification , filling out reservation information as well for getting the knowledge about the room requirement by the person.
These details help in reaching out the particular person if required, number of days he wants to book the room,any extra facility he would like to have etc. After these detail filling activity the room can be reserved successfully.Thus , the most appropriate option is option (b).
Other options are incorrect because room reservation cannot be done without any formality as mentioned in the question and entering contact detail and reservation detail one by one.
// this function will return 1 if the string sent in arguments is palindrome //else it will return 0
int palindrome(int start_of_string, int end_of_string, string &strr)
{
// base case to check if the string is not empty
if (start_of_string>= end_of_string)
return 1;
if (strr[start_of_string] != strr[end_of_string])
return 0;
// recursive call
return palindrome(++start_of_string, --end_of_string, strr);
}
A POINTING DEVICE IS AN INPUT DEVICE THAT ALLOWS A USER TO CONTROL A POINTER ON THE SCREEN. ... A KEYBOARD IS AN INPUT DEVICE THAT CONTAINS KEYS USER TO ENTER DATA AND INSTRUCTIONS INTO A COMPUTER.
SORRY FOR CAPS MY CAPS KEY GOT STUCK