달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

'프로그래밍언어'에 해당되는 글 1

  1. 2007.07.24 15 Exercises for Learning a new Programming Language

15 Exercises for Learning a new Programming Language by: Prashant N Mhatre
새로운 프로그래밍 언어를 배우는데 필요한 15가지 훈련 : Prashant N Mhatre

I've working knowledge of a bunch of programming languages but job demands to learn a new language frequently in a short time.
나는 프로그래밍하는 일을 하는데 종종 일 때문에 짧은 시간안에 새로운 언어를 배워야 하는 경우가 있다.

Instead of reading hundreds manual/book pages, I quickly read 10-15 pages of tutorial or primer.
나는 수백페이지의 매뉴얼이나 책을 읽는 대신, 10~15 페이지 분량의 튜토리얼이나 안내서를 읽는다.

(As you know google is the best search engine to look for such stuff).
(여러분도 알다시피 'google'은 이런 튜토리얼이나 안내서 따위를 검색하는데는 최상의 검색 엔진이다.)

I keep printed copy of the language syntax reference card handy.
나는 언어 문법 reference card를 인쇄해 놓는다.
(There are many reference cards available over internet. Type in 'language to learn' + 'reference card' in google.)
(인터넷에는 수 없이 많은 reference card들이 존재한다. 'google'에서 'language to learn' + 'reference card'를 검색해보라)


First of all, get familiar with Compiler, compiler option, editor shortcuts or integrated development environment (IDE).
무엇보다도, Compiler, compiler option, editor shortcuts, IDE 툴 등에 익숙해져야 한다.

Start with a simple 'Hello World' program.
간단한 'Hello World' 프로그램부터 시작한다.

Compile it. Use basic functionalities of debugger like setting break points, printing variable values, moving to the next or specific position, stopping debugger etc.
컴파일하고, 디버거로 break points 설정, 변수값 출력, 특정 위치로 이동 등의 기본적인 기능들을 사용해보라.


To grasp basics of a new language quickly, here are the exercises I use.
새로운 언어의 기초를 빨리 다지기 위해 내가 사용했던 훈련들이 있다.

Remember some programs may not good for beginners.
몇몇 프로그램들은 초보자들에게 적합하지 않을지도 모른다는 것을 알아두길 바란다.


(1) Display series of numbers (1,2,3,4, 5....etc) in an infinite loop.
    무한 loop 에서 1, 2, 3, 4, 5 등과 같이 연속된 숫자들을 출력하도록 해보라.

    The program should quit if someone hits a specific key (Say ESCAPE key).
 이 프로그램은 누군가가 특정 키-예를 들면 ESC키-를 입력하면 멈추도록 해야 한다.

(2) Fibonacci series, swapping two variables, finding maximum/minimum among a list of numbers.
    피보나치 수열, swap, 여러개의 숫자들 중에 최대/최소값 찾기등을 해보라.

(3) Accepting series of numbers, strings from keyboard and sorting them ascending, descending order.
    사용자가 연속된 숫자나 문자열들을 입력하도록 하고, 입력받은 데이터들을 sorting 해보라.

(4) Reynolds number is calculated using formula (D*v*rho)/mu Where D = Diameter, V= velocity, rho = density mu = viscosity
    Reynolds number는 다음과 같은 식으로 계산된다. (D*v*rho)/mu Where D = Diameter, V= velocity, rho = density mu = viscosity

    Write a program that will accept all values in appropriate units (Don't worry about unit conversion)
 적합한 단위의 모든 값들을 받아들일 수 있는 프로그램을 작성해보라.(단위 변환에 대해서는 신경쓰지 마라.)

 If number is < 2100, display Laminar flow, If it’s between 2100 and 4000 display 'Transient flow' and if more than '4000', display 'Turbulent Flow' (If, else, then...)
 숫자가 2100보다 작으면 'Laminar flow' 라고 출력하고, 숫자가 2100과 4000 사이이면 'Transient flow'라고 출력하고, 숫자가 4000 보다 크면 'Turbulent Flow' 라고 출력하라( if, else, then 을 공부할 수 있다.)

(5) Modify the above program such that it will ask for 'Do you want to calculate again (y/n), if you say 'y', it'll again ask the parameters.  If 'n', it'll exit. (Do while loop)
    위 프로그램을 '다시 계산하시겠습니까? (y/n)' 하고 물어서, 'y' 이면 값들을 다시 입력받도록 하고, 'n' 이면 프로그램이 종료되도록 수정해보라. ( Do while loop에 대해 공부할 수 있다.)

    While running the program give value mu = 0. See what happens.
 프로그램 수행중에 mu 값에 0을 넣어서 무슨 일이 벌어지는지 확인해보라.

 Does it give 'DIVIDE BY ZERO' error?
 '0으로 나누기' 오류가 발생하는가?

 Does it give 'Segmentation fault..core dump?'.
 '세그먼테이션 결함.. 코어 덤프' 오류가 발생하는가?

 How to handle this situation.
 이런 상황들을 어떻게 처리할 것인가.

 Is there something built in the language itself? (Exception Handling)
 언어 자체에 이런 것들을 처리하기 위한 장치가 마련되어 있는가? (예외 처리에 대해서 공부할 수 있다.)

(6) Scientific calculator supporting addition, subtraction, multiplication, division, square-root, square, cube, sin, cos, tan, Factorial, inverse, modulus
    덧셈, 뺄셈, 곱셉, 나눗셈, squre-root, squre, cube, sin, cos, tan, 팩토리얼, inverse, modulus 등을 지원하는 계산기를 만들어보라.

(7) Printing output in different formats (say rounding up to 5 decimal places, truncating after 4 decimal places, padding zeros to the right and left, right and left justification) (Input output operations)
 올림, 내림, 반올림, 반내림, 문자열의 왼쪽 또는 오른쪽에 0을 붙여보거나, 왼쪽 또는 오른쪽으로 문자열을 정렬해보거나 등의 출력 포맷을 다르게 해보라. (입/출력에 대해서 공부할 수 있다.)

(8) Open a text file and convert it into HTML file. (File operations/Strings)
    text 파일을 HTML 파일로 변환해보라. (파일 조작과 문자열에 대해서 공부할 수 있다.)

(9) Time and Date : Get system time and convert it in different formats 'DD-MON-YYYY', 'mm-dd-yyyy', 'dd/mm/yy' etc.
    시스템 시간을 얻어서 'DD-MON-YYYY', 'mm-dd-yyyy, 'dd/mm/yy' 등의 다른 포맷으로 변경해보라

(10) Create files with date and time stamp appended to the name
    파일을 생성할 때 시간과 날짜를 사용하여 파일명을 작성해보라.

(11) Input is HTML table, Remove all tags and put data in a comma/tab separated file.
    HTML 코드로 table을 입력하고, 입력된 데이터에서 모든 tag를 삭제한 후에, comma/tab 구분자를 이용하여 파일로 저장해보라.

(12) Extract uppercase words from a file, extract unique words
    파일에서 문자열을 읽어서 대문자인 문자나, unique한 단어들을 추출해보라.

(13) Implement word wrapping feature (Observe how word wrap works in windows 'notepad')
    단어 감싸기 기능을 구현해보라. (윈도우의 '메모장' 프로그램에서 단어 감싸기 기능이 어떻게 작동하는지 잘 살펴보라.)

(14) Adding/removing items in the beginning, middle and end of the array.
    배열에서 처음, 중간, 끝에 데이터를 추가하거나 삭제해보라.

(15) Are these features supported by your language: Operator overloading, virtual functions, references, pointers etc.
    연산자 오버로딩, virtual function, 참조, 포인터 등이 지원되는지 확인해보라.

About The Author

Prashant N Mhatre

I mainly developed software for Stock Markets and Chemical Instrustries. To learn more about programming, you could refer to the Programming page I maintain.
http://www.onesmartclick.com/programming/programming.html
Also Engineering page
http://www.onesmartclick.com/engineering/engineering.html
prashant_n_mhatre@yahoo.com


# 출처 : http://smartprogrammer.blogspot.com/2006/04/15-exercises-for-learning-new.html
# 번역 : 뽀기

'그거 > 기타' 카테고리의 다른 글

HP 이벤트 진행중~~  (0) 2008.07.02
IDE & ATA & SCSI  (0) 2007.11.05
AJAX 사이트  (0) 2007.10.26
FUD(Fear, Uncertainty, Doubt)  (0) 2007.05.31
당신의 블로그는 얼마짜리 입니까?  (0) 2007.05.03
:
Posted by 뽀기