it/programming

it/programming

[JAVA] 다이어터

Fitness_Club- Club.java( 메인 ) import java.util.Scanner; public class Club { public static void main(String args[]) { Scanner sc=new Scanner(System.in); Cont c=new Cont(); System.out.println("*^* 선린 FITNESS CLUB *^*"); while(true) { System.out.print("1. 등록\t2. 운동\t3.종료\t"); int menu=sc.nextInt(); switch(menu) { case 1: c.enroll(); break; case 2: c.exercise(); break; case 3: return; } } } } - Cont..

it/programming

[javascript] 현재 페이지의 주소를 출력해보자

우리가 써야할 코드는 빼고 document.writeln(location.href);원리는 아주 간단하다. document.writeln 은 java에서 System.out,println과 같은 기능을 하는 출력문이다.그리고 페이지 주소가 담겨있는 기본값 location.href 을 불러 출력하는것일 뿐이다. 일단 한번 적용해보았다.원래 http://hsol.tistory.com[글 번호] 였던 url이 로 바꾸었다. 바뀜에 담긴 의미는야매로 주소를 출력하던 것을 전문적으로 바꿨다고 해야할까쓸데없는 교체지만 어떻게보면 나름대로 큰의미가 있다. 스킨 미리보기화면에서 스킨미리보기 창 주소가 뜨는것도 볼 수있고 동일한 글이지만 카테고리 전체보기를 했을때엔 카테고리 주소가 뜨고, 글을 단독으로 클릭했을때엔 게시..

it/programming

[JAVA] 메소드 생성자 사용 League of Legends 상점구현

import java.util.Scanner; class champ { String code, name; int price; champ(String code, String name, int price) { this.code=code; this.name=name; this.price=price; } champ(String code, String name) { this.code=code; this.name=name; this.price=0; } void purchase() { if(this.price==0) System.out.println("이미 구입한 챔피언 입니다."); else { System.out.println(""); switch(this.code) { case "1": System.out.pr..

it/programming

[JAVA] 메소드와 생성자를 이용한 가상 DB 관리

import java.util.Scanner; class Product { String code, name; int price, discount; Product(String code, String name, int price, int discount) { this.code=code; this.name=name; this.price=price; this.discount=discount; } Product(String code, String name, int price) { this.code=code; this.name=name; this.price=price; this.discount=0; } void setDiscount(int discount){this.discount=discount;} int cal..

it/programming

[JAVA] 메소드 함수 사용하기

import java.util.Scanner; class shape { double ban(int a){return a*a*3.14;} int quare(int a, int b){return a*b;} } public class scan { public static void main(String args[]) { Scanner sc = new Scanner(System.in); shape se = new shape(); int a=1, b=1; while(true) { System.out.print("도형을 선택하시오.(1:원, 2:정사각형, 3:종료) : "); int menu = sc.nextInt(); switch(menu) { case 1: System.out.print("원의 반지름을 입력하시오..

it/programming

[JAVA] 객체 프로그래밍

import java.util.Scanner; public class goods { String name; int num,price,jaego,panmae; void print() { System.out.println(""); System.out.println("상품"+num+"의 이름 : "+name); System.out.println("상품"+num+"의 가격 : "+price); System.out.println("상품"+num+"의 재고수 : "+jaego); System.out.println("상품"+num+"의 판매수 : "+panmae); } public static void main(String[] args) { goods sang[] = new goods[3]; Scanner input..

it/programming

[HTML] audio, video태그와 input태그 실습

이미지 넣기 같은 폴더 이미지 하위 폴더 이미지 오디오 넣기 비디오 넣기 폼 Input태그의 type값 HTML5에서 추가된 type값 이미지 넣기 같은 폴더 이미지 다른 폴더 이미지 오디오 넣기 비디오 넣기 폼 type 값 Input 태그의 type 값 알아보기 type값결과설명 text글자 입력 양식을 생성한다. button버튼입니다. checkbox이건 체크박스로 나타납니다. file파일을 첨부할 때 사용하며, CSS와 곁들어서 사용 가능 hidden이건 숨김필드입니다. 값을 넘겨받을때 숨김속성으로 몰래 감춰지죠. 대부분 form태그의 중요한 속성을 사용할 때 하더군요. image이건 이미지의 경로를 넣어 일반태그 처럼 할 수 있습니다. 단 버튼이 이미지의 경로로 바뀌고,form 태그의 submit..

it/programming

[JAVA] a 와 b 사이의 정수의 합 구하기

import java.util.Scanner; public class scan { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int a=1,b=1,i,sum=0; while(a+b!=0) { System.out.print("정수 2개 입력 : "); a=sc.nextInt(); b=sc.nextInt(); if(a>b) { i=b; b=a; a=i; } for(i=a;i

반응형
훈솔
'it/programming' 카테고리의 글 목록 (7 Page)