1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Reika [66]
3 years ago
13

You're a ticket agent for a commercial airline and responsible for checking the identification for each passenger before issuing

their boarding pass. Due to federal regulations, there is a total of three different forms of ID that can potentially be used. You must determine whether the passenger has the sufficient identification to board the plane or not. Facts: ⢠A passport is enough for a boarding pass ⢠Without a passport, passengers must have two other forms of ID: driver's license birth certificate ⢠If the above two conditions are not met, then they are denied. Input Your solution must take in three boolean inputs. The first input represents whether they have a passport or not. The second input represents whether they have a driver's license or not. The third input represents whether they have a birth certificate or not Output The output should display as a boolean result whether they can board the plane or not. Sample Input Sample output true false false true false true true true false false false false
Computers and Technology
1 answer:
algol133 years ago
3 0

Answer:

Follows are the code to this question:

import java.util.*;//import package for user input  

public class Main //defining class  

{

  public static void main(String[] as)//main method

  {

      boolean x,y,z;//defining boolean variable

      Scanner ox= new Scanner(System.in);//create Scanner class object for user input

      System.out.println("input value: "); //print message  

      x=ox.nextBoolean();//input value

      y=ox.nextBoolean();//input value

      z=ox.nextBoolean();//input value

      System.out.println("Output: ");//print message

      System.out.println(x || (y &&z));//use print method to check value and print its value  

  }

}

Output:

1)

input value:  

true

false

false

Output:  

true

2)

input value:  

false

true

true

Output:  

true

3)

input value:  

false

false

false

Output:  

false

Explanation:

In the given code, inside the class three boolean variable "x,y, and z" is declared, that uses the scanner class for input the value from the user end, and in the next print, the method is declared, that uses " OR and AND" gate for calculating the input value and print its value.

In the AND gate, when both conditions are true. it will print the value true, and in the OR gate, when one of the conditions is true, it will print the value true.  

You might be interested in
5 things that i learned about internet safty
Ksenya-84 [330]
1. To not put your real name in a username
2. Don't give people your personal information
3. Tell your parents if someone messages you something and you don't know them
4. make your social media accounts private
5. Ask for a adult for help if you see something that confuses you
7 0
3 years ago
Read 2 more answers
import java.util.ArrayList; // Needed for ArrayList class /** This program demonstrates how to store BankAccount objects in an A
slega [8]

Answer:

import java.util.ArrayList; // Needed for ArrayList class

/** This program demonstrates how to store BankAccount objects in an ArrayList. */

// Class ArrayListDemo6 is defined

public class ArrayListDemo6 {

// main method that begin program execution

public static void main(String[] args) {

// Create an ArrayList to hold BankAccount objects.

// The arraylist is called list

ArrayList list = new ArrayList();

// Add three BankAccount objects to the ArrayList.

list.add(new bankAccount(100.0)); list.add(new bankAccount(500.0)); list.add(new bankAccount(1500.0)); // Display each item using a for loop

for (int index = 0; index < array.size(); index++)

{ BankAccount account = list.get(index);

System.out.println("Account at index " + index + "\nBalance: " + account.getBalance());

}

}

}

Explanation:

The code is written in Java and more comments has been added to make it more explanatory.

The code snippet is a demonstration on Arraylist.

First Arraylist is imported. Then, ArrayListDemo6 class is defined. Then the main method which begin program execution.

Inside the main method, a new Arraylist is created called list.

Then we add three BankAccount object to the list.

Lastly, we use a for loop to display each added BankAccount object.

7 0
3 years ago
A _______ read inputs the first data item from a file. It typically appears immediately before the loop that processes the data
Evgesh-ka [11]

Answer:

the answer is priming read

Explanation:

hope it helps u

8 0
2 years ago
Order the steps needed to design a relational database.
tia_tia [17]

Answer:

1. List the fields needed to gain information

2. Break down the date into smaller parts

3. identify the fields holding stored data

4.distribute the fields into tables by subject

5. identify the common fields for linking tables

Explanation:

edge 2021

5 0
3 years ago
Elliott is trying to normalize a database that he has designed. Which is not one of the elements of 1NF or 2NF?
Kruka [31]
D. each table must depend on the entire foreing key
4 0
1 year ago
Other questions:
  • Given non-negative integers x and n, x taken to the nth power can be defined as: x to the 0th power is 1 x to the nth power can
    7·1 answer
  • How do you take a screenshot on an iPhone?
    8·2 answers
  • Write a function called simulate_several_key_strikes. It should take one argument: an integer specifying the number of key strik
    7·1 answer
  • Which of the following is true of how the Internet has responded to the increasing number of devices now using the network?
    7·1 answer
  • Suppose that outFileis an ofstreamvariable and output is to be stored in the file outputData.out. Which of the following stateme
    14·1 answer
  • All 24-point fonts take up the same amount of space on a slide. True False
    7·2 answers
  • Globalization is based on <br>​
    10·1 answer
  • Select the correct answer.
    11·1 answer
  • Connect research concepts to their definitions
    13·1 answer
  • When an event occurs, the agent logs details regarding the event. what is this event called?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!