Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package CallExt;
- //Author Lervik
- //Date 01.09.2014
- import java.util.Scanner;
- public class MinOppgave01 {
- public static void main (String args[]) {
- /*
- This file have the task of handling user input and an array. (The user can search the array for a title.)
- */
- String[] titles = {
- "Fellowship","Two Towers","Return Of The King"
- };
- Scanner in = new Scanner(System.in);
- String searchtitle = "";
- for (String title:titles){
- System.out.println("Type the title of a book to see if its in storage");
- searchtitle = in.nextLine();
- if (title.equals(searchtitle)){
- System.out.println("The title " + (searchtitle) + " is aviable in storage.");
- searchtitle = "";
- }
- else {
- System.out.println("The title is not aviable in storage.");
- searchtitle = "";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement