CHAPTER 1 ASSIGNMENT - LEARN JAVA BY EXAMPLE
Trang 1 trong tổng số 1 trang
CHAPTER 1 ASSIGNMENT - LEARN JAVA BY EXAMPLE
Exercise 1 :
Write an application that accepts a string as name of someone from command line arguments then print out “Hello ”+name.
Hint : String name = args[0];
Exercise 2 :
Write an application that accepts two numbers from command line arguments then calculate the total of these numbers and print out.
Hint : int a,b;
a = Integer.parseInt(args[0]);
b = Integer.parseInt(args[1]);
Exercise 3 :
Write an application that accepts a number as radius of a circle. Calculate the perimeter and area of this circle and print out the result.
Hint :
r = Double.parseDouble(args[0]);
Perimeter : P = 2 * Math.PI *r ;
Area: S = Math.PI * r * r;
Exercise 4 :
Write an application that accepts three numbers. Then check them are edge of a triangle or not.
Hint:
Perimeter: P = a + b + c
Area: S = Math.sqrt(p*(p-a)*(p-b)*(p-c)) where: p = (a+b+c)/2
Exercise 5 :
Write an application that accepts three numbers as three edge of a triangle. Then calculate the perimeter and area of this circle and print out the result.
Hint : r = Math.sqrt(x); Math.PI
Lời giải: [You must be registered and logged in to see this link.]
Write an application that accepts a string as name of someone from command line arguments then print out “Hello ”+name.
Hint : String name = args[0];
Exercise 2 :
Write an application that accepts two numbers from command line arguments then calculate the total of these numbers and print out.
Hint : int a,b;
a = Integer.parseInt(args[0]);
b = Integer.parseInt(args[1]);
Exercise 3 :
Write an application that accepts a number as radius of a circle. Calculate the perimeter and area of this circle and print out the result.
Hint :
r = Double.parseDouble(args[0]);
Perimeter : P = 2 * Math.PI *r ;
Area: S = Math.PI * r * r;
Exercise 4 :
Write an application that accepts three numbers. Then check them are edge of a triangle or not.
Hint:
Perimeter: P = a + b + c
Area: S = Math.sqrt(p*(p-a)*(p-b)*(p-c)) where: p = (a+b+c)/2
Exercise 5 :
Write an application that accepts three numbers as three edge of a triangle. Then calculate the perimeter and area of this circle and print out the result.
Hint : r = Math.sqrt(x); Math.PI
Lời giải: [You must be registered and logged in to see this link.]
Similar topics
» CHAPTER 4 ASSIGNMENT - LEARN JAVA BY EXAMPLE
» CHAPTER 2&3 ASSIGNMENT - LEARN JAVA BY EXAMPLE
» CHAPTER 7 ASSIGNMENT - LEARN JAVA BY EXAMPLE
» CHAPTER 5 ASSIGNMENT - LEARN JAVA BY EXAMPLE
» CHAPTER 8 ASSIGNMENT - LEARN JAVA BY EXAMPLE
» CHAPTER 2&3 ASSIGNMENT - LEARN JAVA BY EXAMPLE
» CHAPTER 7 ASSIGNMENT - LEARN JAVA BY EXAMPLE
» CHAPTER 5 ASSIGNMENT - LEARN JAVA BY EXAMPLE
» CHAPTER 8 ASSIGNMENT - LEARN JAVA BY EXAMPLE
Trang 1 trong tổng số 1 trang
Permissions in this forum:
Bạn không có quyền trả lời bài viết
|
|
Fri Jan 10, 2014 5:08 pm by trangan
» Luvina - Tuyển sinh Luvina Academy IX/2013
Tue Apr 09, 2013 2:21 pm by trangan
» LUVINA ACADEMY VIII TUYỂN SINH 2012
Mon Sep 17, 2012 3:16 pm by trangan
» Tuyển sinh khóa học lập trình viên_Luvina Academy VII (Hệ sơ cấp)
Tue Jul 10, 2012 7:01 pm by trangan
» Xin đề thi thực hành,lý thuyết và đáp án của môn Developing Web Services with Java
Tue Jan 10, 2012 12:58 pm by JinHoVN
» Nhờ các PRO vào làm giúp kái đề PCS này với
Fri Jan 06, 2012 1:06 pm by phongvan1991
» Đề cương ôn tập môn CF
Thu Nov 10, 2011 8:20 pm by thanhnc_b01392
» xin slide môn C
Sun Sep 04, 2011 5:33 pm by anhchang064
» Drugs In Japan
Tue Aug 02, 2011 5:58 am by Khách viếng thăm