-
-
Save alexnask/5356365 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyUtils { | |
private static String Isearch; | |
public static void seqSearch(Book[] pin, int key){ | |
for(int i=0; i<pin.length ;i++){ | |
if(key==1){ | |
if(Isearch==pin[i].getISBN()){ | |
} | |
} | |
} | |
} | |
public static void binSearch(Book[] pin, int key){ | |
} | |
public static void main (String args[]) { | |
Book pin[]=new Book[10]; | |
int ep=0; | |
int i=0; | |
boolean flag=true; | |
for( ;flag ; ) | |
{ | |
System.out.println(" Λίστα Επιλογών"); | |
System.out.println("1. Εισαγωγή στοιχείων βιβλίου"); | |
System.out.println("2. Αναζήτηση βιβλίου"); | |
System.out.println("3. Εμφάνιση στοιχείων βιβλίων με τιμή μεταξύ κάποιων ορίων"); | |
System.out.println("4. Εμφάνιση στοιχείων όλων των βιβλίων"); | |
System.out.println("5. Τέλος"); | |
System.out.println(" "); | |
System.out.println(" Δώστε Επιλογή(1-4):"); | |
ep=UserInput.getInteger(); | |
switch (ep) { | |
case 1: | |
if (i<10) { | |
System.out.println("Dwse titlo vivliou:"); | |
String titlos=UserInput.getString(); | |
System.out.println("Dwse onoma suggrafea:"); | |
String name=UserInput.getString(); | |
System.out.println("Dwse ISBN:"); | |
String ISBN=UserInput.getString(); | |
System.out.println("Dwse ekdotiko oiko:"); | |
String ekd=UserInput.getString(); | |
System.out.println("Dwse arithmo selidwn:"); | |
int number=UserInput.getInteger(); | |
System.out.println("Dwse etos ekdosis:"); | |
int etos=UserInput.getInteger(); | |
System.out.println("Dwse timi vivliou:"); | |
double price=UserInput.getDouble(); | |
pin[i]=new Book( titlos , name , ISBN , ekd , number , etos , price); | |
} | |
System.out.println("Menoun akoma"+(10-i)+"theseis"); | |
case 2: | |
System.out.println(" Επιλογή Πεδίου Αναζήτησης"); | |
System.out.println("1. ISBN"); | |
System.out.println("2. Έτος κυκλοφορίας"); | |
System.out.println("3. Επιστροφή στην Αρχική Λίστα Επιλογών"); | |
System.out.println(" "); | |
System.out.println(" Δώστε Επιλογή(1-3):"); | |
int epSearch = UserInput.getInteger(); | |
if (epSearch==1) { | |
System.out.println("Dwse ISBN gia anazitisi"); | |
Isearch=UserInput.getString(); } | |
else if (epSearch==2) { | |
System.out.println("Dwse Etos kukloforias gia anazitisi"); | |
int Esearch=UserInput.getInteger(); | |
} | |
if (epSearch!=3) { | |
System.out.println(" Επιλογή Μεθόδου Αναζήτησης"); | |
System.out.println("1. Σειριακή Αναζήτηση"); | |
System.out.println("2. Δυαδική Αναζήτηση"); | |
System.out.println("3. Επιστροφή στην Επιλογή Πεδίου Αναζήτησης"); | |
System.out.println(" "); | |
System.out.println(" Δώστε Επιλογή(1-3):"); | |
} | |
int epSearch2 = UserInput.getInteger(); | |
if(epSearch2==1) seqSearch(pin,epSearch); | |
if(epSearch2==2) binSearch(pin,epSearch); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment