You are supposed to make two simple programs in this week.

1. Based on the rectangle class example in our text book, add "intersection method" to the rectangle class. The intersection method returns the intersection of two rectangles, that is the rectangle formed by two overlapping rectangles.

You call this method as follows:

Rectangle r3 = r1.intersection(r2);

r3 is the intersection rectangle formed by r1 and r2.

Write a program IntersectionPrinter that constructs two rectangle objects, prints them, and then prints the rectangle object that describes the intersection. Then the program should print the result of the intersection method when the rectangles do not overlap. Add a comment to your program that explains how you can tell whether the resulting rectangle is empty.

2. Write a program HollePrinter that switches the letters "e" and "o" in a string. Use the replace method repeatedly. You don't need to get inputs from console or GUI. Place the input in your code (For example String input = "Hello, World"). Demonstrate that the string "Hello, World!" turns into "Holle, Werld!".

내용은 요렇게,,,

역시 파일은 여기(였는데,,, due가 넘어가는바람에 검열당한,,,)

'대학생활 > JAVA' 카테고리의 다른 글

내맘대로 강좌 JAVA편 4  (0) 2009.03.25
내맘대로 강좌 JAVA편 3  (0) 2009.03.25
3주차 JAVA숙제가 나왔습니다^^  (2) 2009.03.23
내맘대로 강좌 JAVA편 2  (0) 2009.03.16
내맘대로 강좌 JAVA편 1  (3) 2009.03.16

You need to set up a C++ compiler in your computer. I recommend Microsoft Vistual C++ Express. It is free. Another option is using Cygwin G++ compiler, which is also free.

In this week, you will make three simple programs.

1. Write a program that asks the user for the lengths of the sides of a rectangle. Then print

The area and perimeter of the rectangle
 
The length of the diagonal (use the Pythagorean theorem)
 

2. Write a program that prompts the user for the names and salaries of three employees. Then print out the average salaries of the employees. Information about each employee must be stored in an employee object.

3. Write a program that reads a number greater than or equal to 1,000 from the user and prints it out with a comma separating the thousands. Here is a sample dialog; the user input is in color:

    Please enter an integer >= 1000:  23456    23,456

내용은 대략 요거,,,

내 풀이는,,,, 이거참조(였는데,,, due가 길어져서 검열당한,,,)

'대학생활 > C++' 카테고리의 다른 글

내맘대로 강좌 C++편 5  (2) 2009.03.19
내맘대로 강좌 C++편 4  (2) 2009.03.18
내맘대로 강좌 C++편 3  (4) 2009.03.17
내맘대로 강좌 C++편 2  (1) 2009.03.17
내맘대로 강좌 C++편 1  (0) 2009.03.16
뭐,, 어찌어찌 잡담 2009. 3. 15. 20:45

드디어 대학생활 시작이다!!!(라지만 벌써 2주가 지나 3주차다,,,)

일단은 강의도 대략 신청했고, 대략 대학생활에 전혀 적응 하지못하고있다.

일단 내 하루 일과를 보면,,,

1:00 am~7:00 am(9시 강의 있는날)9:00am (강의 없는날)

그후로 대략 강의,,,

6:00pm 저녁식사,,,

그후로 ,,,, 놀기!!!!!!!!! 숙제,,,

뭐 그러다가 다시 1am에 취침,,,

토 일욜은 12시 기상이라는,,,

 

'잡담' 카테고리의 다른 글

샨새교 귀엽네요,,,  (2) 2009.04.01
이분들 뭥미,,^^  (0) 2009.03.19
한동안 못들어 왔네,,,  (0) 2009.02.25
해리포터 6편,,  (0) 2009.02.09
MarineBoy봤다!!!  (0) 2009.02.07