본문 바로가기

All Posts107

[JavaScript공부 - 5] Variables(변수) 대부분의 경우에 자바스크립트는 정보를 처리해야함. 이에 대한 예로 2가지를 들어보면 1. 온라인 쇼핑몰 - 온라인 쇼핑몰의 정보는 쇼핑몰에서 파는 물건과 쇼핑카트에 담겨진 물건에 대한 정보가 포함되어 있음.2, 채팅 어플리케이션 - 채팅 어플리케이션은 사용자, 사용자들이 보내는 메세지 등등을 포함하는 정보가 있음. Variables(변수)는 이러한 정보를 저장하는 데에 사용됨. A variable (변수) 변수는 "이름이 붙여진 데이터 저장고"임. 우리는 상품이나 방문자 등에 대한 데이터를 변수를 사용하여 저장할 수 있음. 자바스크립트에서 변수를 사용하기 위해서는 "let"이라는 키워드를 사용함. 아래의 구문은 "message"라는 이름을 가진 변수를 생성(다른 말로, 선언 또는 정의)를 하는 예시임. .. 2019. 1. 21.
[2019.01.21] Testing Problem This problem is all about unit testing.Your company needs a function that meets the following requirements:For a given array of integers, the function returns the index of the element with the minimum value in the array. If there is more than one element with the minimum value, the returned index should be the smallest one.If an empty array is passed to the function, it should raise an E.. 2019. 1. 21.
[JavaScript 공부 -4] JavaScript의 "use strict" 오래전부터 자바스크립트는 호환성 문제 없이 발전해 옴. 기존의 기능이 변경되지 않는 동안 자바스크립트에는 새로운 기능이 추가됨. 그래서 기존에 존재하는 코드를 변경할 필요가 없다는 장점을 가지고 있으나, 부작용으로는 자바스크립트의 제작자의 불안정한 부분이나 실수들이 이 언어에 영원히 남게됨. 이 경우는 2009년 ECMAScript 5(ES5)가 나타났을 때, 자바스크립트에 새 기능을 추가하고 기존의 기능의 일부를 수정하려고 했음. 기존의 코드가 작동되게 유지하기 위해서, 대부분의 수정이 기본 설정을 해제하게 됨. 기본 설정을 유지하기 위해서는 명시적으로 "use strict"라는 명령을 사용할 수 있음. "use strict"이 명령어는 String처럼 보임. ("use strict"나 'use str.. 2019. 1. 17.
[2019.01.17] Nested Logic Problem Objective Today's challenge puts your understanding of nested conditional statements to the test. You already have the knowledge to complete this challenge, but check out the Tutorial tab for a video on testing!Task Your local library needs your help! Given the expected and actual return dates for a library book, create a program that calculates the fine (if any). The fee structure is as.. 2019. 1. 17.
[JavaScript공부 -3] 코드의 구조 Statements Statements는 구문의 구성요소이며 행동을 수행하는 명령들을 이야기 함. 1alert("hello world!");cs 위의 코드는 hello world!라는 메세지를 보여주는 statement임. Javascript에서 이 statements들은 세미콜론(;)에 의해서 구분되고 나뉘어짐. 예를 들어, 아래와 같이 Hello와 world!를 따로 보여주려면 두 개의 alert구문을 세미콜론으로 나누면 됨. 1alert("hello"); alert("world!");cs 보통은 코드를 읽기 쉽게 하기 위해서 구문(statements)들을 줄바꿈을 통해서 구분해 줌! 12alert("hello"); alert("world!");c Semicolons(세미콜론, ; )statement.. 2019. 1. 16.
[2019.01.16] Running Time and Complexity Problem Objective Today we're learning about running time! Check out the Tutorial tab for learning materials and an instructional video!Task A prime is a natural number greater than that has no positive divisors other than and itself. Given a number, , determine and print whether it's or .Note: If possible, try to come up with a primality algorithm, or see what sort of optimizations you come up .. 2019. 1. 16.
[SpringBoot] 프로젝트 생성 및 Controller와 HTML연동 [SpringBoot] 프로젝트 생성 및 Controller와 HTML연동 SpringBoot를 이야기만 들어봤지 한 번도 사용해 본적이 없었다. 개인적으로 간단한 프로젝트를 하기 위해서 이번에는 Spring이 아닌 Spring Boot를 사용해 보았다. 프로젝트를 생성하고 타임리프(Thymleaf)를 사용하여 Controller와 HTML을 연동하는 부분을 기록해 봄! 1. 프로젝트 생성 # Package Explorer 영역에서 오른쪽 클릭 후, New > Spring Starter Project 를 선택하여 프로젝트를 생성하는 창을 만든다. [생성 위치] # 가볍게 Name정도만 바꿔주기! # 기본적으로 HTML을 사용하여 웹을 연동해주는 Thymleaf와 Web을 기본 세팅으로 설정하고 Finis.. 2019. 1. 15.
[2019.01.15] More Linked Lists Problem Objective Check out the Tutorial tab for learning materials and an instructional video!Task A Node class is provided for you in the editor. A Node object has an integer data field, , and a Node instance pointer, , pointing to another node (i.e.: the next node in a list).A removeDuplicates function is declared in your editor, which takes a pointer to the node of a linked list as a paramet.. 2019. 1. 15.
[2019.01.14] BST Level-Order Traversal Problem Objective Today, we're going further with Binary Search Trees. Check out the Tutorial tab for learning materials and an instructional video!Task A level-order traversal, also known as a breadth-first search, visits each level of a tree's nodes from left to right, top to bottom. You are given a pointer, , pointing to the root of a binary search tree. Complete the levelOrder function provi.. 2019. 1. 14.