• Share this text:
Report Abuse
Untitled - posted by guest on 22nd May 2020 02:14:22 PM

/*

 * To change this license header, choose License Headers in Project Properties.

 * To change this template file, choose Tools | Templates

 * and open the template in the editor.

 */


package studentprogram;

import java.util.Scanner;

/**

 *

 * @author Stefan

 */

public class StudentProgram {


    /**

     * @param args the command line arguments

     */

    public static void main(String[] args) {

        // TODO code application logic here

        Scanner scanner1 = new Scanner(System.in);

        System.out.println("Are you enrolled?");

        Boolean enrolled = scanner1.nextBoolean();

        System.out.println("Do you have a library card?");

        Boolean hasLibraryCard = scanner1.nextBoolean();

 

if (enrolled = false)

{

   System.out.println("Go to student services");

}

else

{

   if (enrolled == true && hasLibraryCard == false)

   {

      System.out.println("See the librarian to get a library card");

   }

   else if(enrolled == true && hasLibraryCard == true)

   {

      System.out.println("Go to the library");

   }

}


}


Report Abuse

Login or Register to edit or copy and save this text. It's free.