import java.io.File;
import java.io.FileInputStream;
import java.sql.Savepoint;
import java.util.Scanner;
public class Pro1111 {
static Scanner sc = null;
static String [] sdata_name = new String [100];
static String [] sdata_attribute = new String[100];
static String [] svalue = new String[100];
static int key = -1;
FileInputStream fis = null;
public static void main(String[] args) {
do{
String nu = menu();
int nuu=999;
try{ nuu = Integer.parseInt(nu);}catch(Exception e){System.out.println("please number.");}
if(nuu== 0){break;}
else if(nuu ==1){input_data(); input_attribute();input_value(key);}
else if(nuu ==2){view_data();}
else if(nuu==3){operation_data();}
}while(true);
}
private static void operation_data() {
sc = null;
String yn=null;
int i=0,ibe=0;
System.out.println("operation");
System.out.println("relation key: ");
do{ sc = new Scanner(System.in);
try{ i = sc.nextInt();ibe=1;} catch (Exception e){System.out.println("please number.");ibe=0;}
if(ibe==1){
System.out.println("key: "+ i + " sdata_name: "+ sdata_name[i]+ " svalue: "+ svalue[i]+ " type: "+ sdata_attribute[i]);
System.out.println("This data? y/n");
operation_data_in(i);
}
}while(sc==null);
}
private static void operation_data_in(int i) {
// TODO Auto-generated method stub
}
private static void view_data() {
System.out.println("view data..");
for(int i=0; i<=key; i++){
System.out.println("key: "+ i + " sdata_name: "+ sdata_name[i]+ " svalue: "+ svalue[i]+ " type: "+ sdata_attribute[i]);
}
}
private static void input_value(int key2) {
System.out.println("input value key " + key + " "+sdata_name[key] + " ?");
sc = null;
do{
sc = new Scanner(System.in);
String value = sc.nextLine();
svalue[key] = value;
System.out.println();
System.out.println("ok");
}while(sc==null);
}
private static void input_data() {
key++;
System.out.println("key: "+key );
System.out.println("input data name:");
sc =null;
do{
sc= new Scanner(System.in);
String > sdata_name[key] = data;
}while(sc==null);
}
private static void input_attribute() {
System.out.println("key: "+key );
System.out.println("input data_attribute:");
System.out.println("t)time(sec)/ n)name / b)boolean");
sc =null;
do{
sc= new Scanner(System.in);
String > sdata_attribute[key] = data;
}while(sc==null);
}
private static String menu() {
sc = null;
sc = new Scanner(System.in);
System.out.println("0. exit");
System.out.println("1. input");
System.out.println("2. view data");
System.out.println("3. operation");
return sc.nextLine();
}
}
써도 되고, 역슬래쉬 잘 안나온다고 하더라..
File save, load 만들 예정.. operation을 만든 다음, 전체 실행도 추가할 예정 ㅇㅇ
코딩 더럽네
류나는 부분 String sdata_name[key] = data; 이런식으로 하면 됨
String sdata_name[key] = data; 스트링 데이터 는 에쓰씨점넥스트라인괄호괄호
에스데이터언더바네임중괄호키중괄호는데이터
이 오류나는 스트링 부분 이렇게 하면 될거다.
sdata_name, sdata_attribute, svalue 이 세개 이름이야..
sdata_name, sdata_attribute, svalue 이 세개 이름이야..
sdata_name, sdata_attribute, svalue 이 세개 이름이야..
스트링 데이터 는 에쓰씨점넥스트라인괄호괄호
이거 해주고, 다음엔 함수에 따라서 sdata_name[key] sdata_attribute[key], svalue[key] 이 변수에, 데이터를 넣어주면 된다.
에스데이터언더바네임중괄호키중괄호는데이터 이런식으로 ㅇ 각각