Answer:
See explaination
Explanation:
The program code
import java.util.ArrayList;
public class Main
{
public static void main(String[] args)
{
ArrayList<AirlineTicket> tickets = new ArrayList<AirlineTicket>();
//This creates a randomized list of passengers
addPassengers(tickets);
for(AirlineTicket elem: tickets)
{
System.out.println(elem);
}
//This creates a TicketOrganizer object
TicketOrganizer ticketOrganizer = new TicketOrganizer(tickets);
//These are the methods of the ticketOrganizer in action
System.out.println("\nPassengers Ordered by Boarding Group:");
ticketOrganizer.printPassengersByBoardingGroup();
System.out.println("\nPassengers in line who can board together:");
ticketOrganizer.canBoardTogether();
}
//Do not touch this method! It is adding random passengers to the AirlineTicket array
public static void addPassengers(ArrayList<AirlineTicket> tickets)
{
String[] seats = {"A","B","C","D","E","F"};
for(int index = 0; index< 15; index++)
{
int random = (int)(Math.random() * 5);
AirlineTicket ticket = new AirlineTicket("Passenger " + (index+1), seats[random], ((int)(Math.random()*5)+1), ((int)(Math.random()*8)+1));
tickets.add(ticket);
}
}
}
class TicketOrganizer
{
private ArrayList<AirlineTicket> tickets ;
//constructor with parameter as an arraylist of AirlineTicket
public TicketOrganizer(ArrayList<AirlineTicket> tickets)
{
this.tickets = tickets;
}
//methhods to return the arraylist of airlines
public ArrayList<AirlineTicket> getTickets()
{ //re-organize the ticket first
ArrayList<AirlineTicket> tickets_organized = new ArrayList<AirlineTicket>();
for(int i=1; i<=5; i++)
{
for(AirlineTicket ticket: tickets)
{
if(ticket.getBoardingGroup() == i)
{
tickets_organized.add(ticket);
}
}
}
return tickets_organized;
}
//print the tickets based on boardingGroup
public void printPassengersByBoardingGroup()
{
int count = 0;
for(int i=1; i<=5; i++)
{
System.out.println("Boarding Group " + i + ":");
for(AirlineTicket ticket : tickets)
{
if(ticket.getBoardingGroup() == i)
{
System.out.println("Passenger " + ticket.getName());
}
}
}
See attachment for sample output
Answer:
When you move or size a control in the Form Designer, Visual Studio automatically adjusts the properties that specify the location and size of the control.
Answer:
The solution is provided in the explanation section.
Detailed explanation is provided using comments within the code
Explanation:
import java.util.*;
public class Main {
//The Bubble sort method
public static void bb_Sort(int[] arr) {
int n = 10; //Length of array
int temp = 0; // create a temporal variable
for(int i=0; i < n; i++){
for(int j=1; j < (n-i); j++){
if(arr[j-1] > arr[j]){
// The bubble sort algorithm swaps elements
temp = arr[j-1];
arr[j-1] = arr[j];
arr[j] = temp;
}
}
}
}
public static void main(String[] args) {
//declaring the array of integers
int [] array = new int[10];
//Prompt user to add elements into the array
Scanner in = new Scanner(System.in);
//Use for loop to receive all 10 elements
for(int i = 0; i<array.length; i++){
System.out.println("Enter the next array Element");
array[i] = in.nextInt();
}
//Print the array elements before bubble sort
System.out.println("The Array before bubble sort");
System.out.println(Arrays.toString(array));
//Call bubble sort method
bb_Sort(array);
System.out.println("Array After Bubble Sort");
System.out.println(Arrays.toString(array));
}
}
Answer:
As u are the in charge of system maintainance u have to maintain safety and security to the system.as the system maintainance is a very big role and u can say it is the key to ur company or to ur work.
B. Hierarchical
C. Linear
D. Group
Answer:B)Hierarchical
Explanation: Hierarchical order classifies the distribution of the data into the groups and their subgroups .The division of these groups and subgroups appear in the structure of pyramid generally.
The classification done in the hierarchical order is based on the authority on each level e.g.-the level with high authority is situated at higher level and below it, followed by its subgroup components.So, the correct option is option(B).
Answer:
The answer to this question is given below in the explanation section.
Explanation:
My laptop's current screen resolution is (1366 by 768 recommended). When you change your screen resolution, your pc automatically suggests the recommended screen resolution that helps you to view more information on your screen and enable you to fit the most information on the screen while still being able to read the display.
To change the screen resolution, you need to go through from the following steps:
Answer:
To edit an existing pattern, double-click the pattern in the pattern swatch, or select an object containing the pattern and choose Object > Pattern > Edit Pattern