블로그
-
[영진전문대학 컴퓨터 정보계열]자바 프로그래밍 15장 6번
25,18,0,11,10,25,40,36,50,32}; int yv[] = {0,15,20,33,50,42,50,32,20,15}; public Star(Graphics g, int x, int y) { int[] tmpx = new int[10]; int[] tmpy = new int[10]; for(int i=0 ; i
blog.naver.com · 2013.10.26
-
[영진전문대 컴퓨터정보계열 프로그래밍전공]9월 12일 수업내용
Rectangle{ public int x; public int y; int sum=0; int age = 0; public void setArea(int x, int y) { this.x = x; this.y = y; } public int getArea() { sum = x*y; return sum; } public int getAge() { age = 2*(x+
blog.naver.com · 2013.09.12
-
[영진전문대 컴퓨터정보계열 프로그래밍전공]자바의 개요2
(String[] args) { // TODO Auto-generated method stub int sum; int x, y; x = Integer.parseInt(args[0]) ; y = Integer.parseInt(args[1]); Exam examobject = new Exam(); sum =.......
blog.naver.com · 2013.08.29
-
[영진전문대 컴퓨터정보계열 프로그래밍전공]실습
형변환 : 어떤 자료형의 값을 다른 자료형으로 값으로 바꾸어 주는 연산 - (새로운 자료형) 수식; (y = (double) x; if-else문 반복문 - while문 : 조건이 실습 public class sdaf { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated
blog.naver.com · 2013.09.02
-
반복문
); x=scan.nextInt(); y=scan.nextInt(); while(y! =0){ r=x%y; x=y; y=r; } System.out.printf("최대 공약수는%d입니다.
blog.naver.com · 2013.04.17
-
(영진전문대 컴퓨터프로그래밍전공반) C++ 상향,하향 형변환
// 실습 (p.346 예제) #include #include using namespace std; class Shape { protected: int x, y; public: void setOrigin(int x, int y) { this->x = x; this-> y = y; } void draw() { cout << "Shape
blog.naver.com · 2012.11.26
-
(영진전문대 컴퓨터프로그래밍전공반) C++ 9장 LAB
// 실습 (p.377 LAB) #include #include using namespace std; class Base { public: int x; Base(): x(0) { Base { public: int y; Derived():y(20) { x = 100; } virtual void print() { cout << "Derived Class
blog.naver.com · 2012.11.27
-
(영진전문대 컴퓨터프로그래밍전공반) c++ +연산자 함수 작성
0.0, double yvalue = 0.0) : x(xvalue), y(yvalue) { } void display() { cout << "(" << x & Vector& v2) { Vector v(0.0, 0.0); v.x = v1.x + v2.x; v.y = v1.y+ v2.y; return v; } int main() {
blog.naver.com · 2012.12.03
-
(영진전문대 컴퓨터프로그래밍전공반) C++ 8장 연습문제(프로그래밍)
#include using namespace std; class Shape { protected: int x,y; double area, girth;// 면적, 둘레 public: int getX() { return x; } void setX(int x) { this->x = x; } int getY() { return y; } void s.......
blog.naver.com · 2012.11.26
-
(영진전문대 컴퓨터프로그래밍전공반) C++ 상속에서 생성자와 소멸자
#include using namespace std; class Shape { int x, y; public: Shape() { cout << "Shape 생성자()" << endl; } ~Shape() { cout << "Shape 소멸자()" << endl; } }; class Rectangle : public
blog.naver.com · 2012.11.20