Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

15주차 5번, 6번 문제 제출합니당! #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions K-0joo/11week_quiz_answer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// email
let email = /[a-zA-Z0-9]@[a-zA-Z0-9]\.[a-zA-Z]/;

console.log(email.test('[email protected]'))
console.log(email.test('dd22.dfsf'))
console.log(email.test('werw111r@dfsg223'));
console.log(email.test('13213fdsdf'));

// phone
let phone = /01\d-\d{4}-\d{4}/;

console.log('This is phone');
console.log(phone.test('010-1234-2424'));
console.log(phone.test('010231233123'));
console.log(phone.test('adfsgfsagsag'));
console.log(phone.test('21321-412'));
console.log(phone.test('ㄱㄴㄱㄴㄷ-ㄱㄴㄱㄴㅁ'));

// postNum
let postNum = /([1-63]{2})+(\d{1})+([0-99]{2})/;

console.log('This is Post Number');
console.log(postNum.test('12151'));
console.log(postNum.test('asdfaw'));
console.log(postNum.test('12345678'));
console.log(postNum.test('31234'));
45 changes: 45 additions & 0 deletions K-0joo/15week_quiz_No5.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
function GotoSchool(){ // async는 function 앞에 위치, 항상 프라미스를 반환
return new Promise((resolve, reject) => {
setTimeout(function() {
resolve("집에서 출발!");
})
})

}

function School() {
return new Promise((resolve, reject) => {
setTimeout(function() {
resolve("학교 도착~");
}, 3000) // 30분 3초로 생략
})
}

function EatHaribo() {
return new Promise((resolve, reject) => {
setTimeout(function() {
resolve("하리보 냠냠 :D");
})
})
}

function StartClass() {
return new Promise((resolve, reject) => {
setTimeout(function(){
resolve("수업");
})
})
}

async function startGotoSchool(){
const out = await GotoSchool();
console.log(out);
const arrive = await School();
console.log(arrive);
const eat = await EatHaribo();
console.log(eat);
const nojam = await StartClass();
console.log(nojam);
}

startGotoSchool();
54 changes: 54 additions & 0 deletions K-0joo/15week_quiz_No6.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
function GotoSchool(){ // async는 function 앞에 위치, 항상 프라미스를 반환
return new Promise((resolve, reject) => {
resolve("집에서 출발!");
})

}

function School() {
return new Promise((resolve, reject) => {
setTimeout(function() {
resolve("학교 도착~");
}, 3000) // 30분 3초로 생략
})
}

const weather = ['hurricane', 'sunny day'];

const randomWeather = weather[Math.floor(Math.random() * weather.length)];

function EatHaribo() {
return new Promise((resolve, reject) => {
if(randomWeather === 'sunny day'){
setTimeout(() => {
resolve("하리보 냠냠 :D");
});
} else if (randomWeather === 'hurricane') {
reject("헉 태풍이라니 자휴해야겠당");
}
})
}

function StartClass() {
return new Promise((resolve, reject) => {
resolve("수업");
})
}

async function startGotoSchool(){
try {
const out = await GotoSchool();
console.log(out);
const arrive = await School();
console.log(arrive);
const eat = await EatHaribo();
console.log(eat);
const nojam = await StartClass();
console.log(nojam);
} catch(e){
console.log(e);
console.log("집도착~!");
}
}

startGotoSchool();
73 changes: 61 additions & 12 deletions K-0joo/9week_quiz_answer.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,68 @@
function JavaScriptDeepStudy(name, book, process){
let name = new Array("최정혜", "김영주", "김현지", "손진영", "조진혁", "윤한영");
let book = new Array("자바스크립트완벽가이드7판", "자바스크립트완벽가이드7판", "자바스크립트완벽가이드7판", "자바스크립트완벽가이드7판", "자바스크립트완벽가이드7판", "자바스크립트완벽가이드7판");
let process = new Array("진행중", "진행중", "진행중", "진행중", "진행중", "잠시중단");

function Person(gender, age, language, fruit){
let gender = ("여", "여", "여", "남", "남", "남");
let language = ("JavaScript", "JavaScript", "JavaScript", "JavaScript", "TypeScript", "JavaScript");
let age = ("25", "24", "23", "25", "22", "25");
let fruit = ("StrawBerry", "StrawBerry", "StrawBerry", "Apple", "Grape", "Orange");
class JavaScriptDeepStudy { // class 선언 법 : Class 클래스명 {}
constructor(name, book, process, member){ // constructor : 클래스의 생성자 함수를 의미
this.name = name;
//["최정혜", "김영주", "김현지", "손진영", "조진혁", "윤한영"];
this.book = "자바스크립트완벽가이드7판";
this.process = process;
//["진행", "진행", "진행", "진행", "진행", "잠시 중단"];
this.member = ["최정혜", "김영주", "김현지", "손진영", "조진혁", "윤한영"];
}

CurrentProcess(){
console.log("현재 진행 상태는 " + this.process + "중 입니다.");
}

FindSpy(member){
if(member === true){
console.log("최강 JavaScript 멤버 ★");
} else {
console.log("찾았다! 스파이!");
}
}
}

class Person extends JavaScriptDeepStudy { // 다른 클래스를 상속하는 서브 클래스를 정의할 때는 Class 키워드와 함께 extends 키워드를 사용함.
constructor(name, gender, age, favoritLanguage, favoritFruit){
super();
this.name = name;
this.gender = gender;
// ["여", "여", "여", "남", "남", "남"];
this.age = age;
// ["25", "24", "23", "25", "22", "25"];
this.favoritLanguage = favoritLanguage
//["JavaScript", "JavaScript", "JavaScript", "JavaScript", "TypeScript", "JavaScript"];
this.favoritFruit = favoritFruit
// ["StrawBerry", "StrawBerry", "StrawBerry", "Apple", "Grape", "Orange"];

}

twentyFive() {
if(this.age + 1 > 25 || this.age === 25){
console.log("청춘은 바로 지금부터~ 청바지~");
return Number(this.age) + 1;
} else {
console.log("반오십을 향해 달려가는 중..");
}

}

PastOfTwoYears() {
console.log("2년 전 나이는" , this.age - 2 , "살~! 이 때 참 좋았죠");
}

class YoungJoo {
if(name[0] )
LoveJH(){
if(this.favoritFruit === "StrawBerry"){
console.log("딸기 좋앙♥");
} else {
console.log("안타깝게도 저희와 함께 할 수 없습니다.");
}
}
}

let YoungJoo = new Person("김영주", "여", "24", "JavaScript", "StrawBerry");

console.log(YoungJoo.twentyFive());
console.log(YoungJoo.PastOfTwoYears());
console.log(YoungJoo.LoveJH());
console.log('------------');
// ㅠ0ㅠ 죄송합니다 흑흑흑....기억에서 지워주세요