LuckyStar Rìu Bạc
Tổng số bài gửi : 139 Điểm Thưởng : 5318 Số lần được cám ơn : 2 Join date : 13/10/2010 Age : 35 Đến từ : Trường cao đẳng Công Nghệ và Quản Trị Doanh Nghiệp
| Tiêu đề: Bài tập java Nhóm 6 đã làm (1.6, 2.11, 2.12) Wed Sep 21, 2011 1:19 am | |
| Đây là bài tập java nhóm mình đã làm các bạn download về tham khảo nha 1.6: CHUONG TRINH TIM CHU VI VA DIEN TICH HINH TRON - Trích dẫn :
import java.io.*; class bai1 { public static void main(String[] args) throws Exception { BufferedReader in=new BufferedReader (new InputStreamReader(System.in)); System.out.println("CHUONG TRINH TIM CHU VI VA DIEN TICH DUONG TRON"); System.out.println("NHOM 6"); System.out.println("Bai tap 1.6\n"); System.out.print("Nhap ban kinh: "); float x=Float.parseFloat (in.readLine()); float y,z; y=x*2*3.14f; z=x*x*3.14f; System.out.println("Chu vi la: "+y+"\nDien tich la: "+z); } }
2.11: CHUONG TRINH GIAI PHUONG TRINH BAC 2 - Trích dẫn :
import java.io.*; import java.lang.Math; class bai2 { public static void main(String[] args) throws Exception { BufferedReader in=new BufferedReader (new InputStreamReader(System.in)); System.out.println("CHUONG TRINH GIAI PHUONG TRINH BAC 2"); System.out.println("NHOM 6"); System.out.println("Bai tap 2.11\n"); System.out.print("Nhap he so a: "); float a=Float.parseFloat (in.readLine()); System.out.print("Nhap he so b: "); float b=Float.parseFloat (in.readLine()); System.out.print("Nhap he so c: "); float c=Float.parseFloat (in.readLine()); double x,x1; if(a==0) { x= -(c/b); System.out.println("x= "+x); } else { double d=b*b-4*a*c; if(d<0) System.out.println("Phuong trinh vo nghiem"); else { if(d==0) { x= -b/2*a; System.out.println("x= "+x); } else { double e; e = Math.sqrt(d); System.out.println("Phuong trinh co 2 nghiem:"); x=(-b+e)/2*a; x1=(-b-e)/2*a; System.out.println("x= "+x+"\nx1= "+x1); } } } } }
2.12: CHUONG TRINH CHUYEN DOI NHIET DO CELCIUS SANG FARENHEIT - Trích dẫn :
import java.io.*; class bai2a { public static void main(String[] args) throws Exception { BufferedReader in=new BufferedReader (new InputStreamReader(System.in)); System.out.println("CHUONG TRINH CHUYEN DOI NHIET DO CELCIUS SANG FARENHEIT"); System.out.println("NHOM 6"); System.out.println("Bai tap 2.12\n"); System.out.print("Nhap nhiet do Celcius: "); int x=Integer.parseInt (in.readLine()); int i; for(i=0;i<=20;i=i+1) { float y =1.8f*x+32; System.out.println(" "+x+" Celcius = "+y+" Farenheit"); x++; } } }
Bạn nào thích thì có file download bên dưới, các bạn download về chạy thử. Chúc các bạn thành công [You must be registered and logged in to see this image.]. - Attachments
- Bai1.zip
- CHUONG TRINH TIM CHU VI VA DIEN TICH DUONG TRON
- You don't have permission to download attachments.
- (1 Kb) Downloaded 2 times
- bai2.zip
- CHUONG TRINH GIAI PHUONG TRINH BAC 2
- You don't have permission to download attachments.
- (1 Kb) Downloaded 4 times
- bai2a.zip
- CHUONG TRINH CHUYEN DOI NHIET DO CELCIUS SANG FARENHEIT
- You don't have permission to download attachments.
- (1 Kb) Downloaded 3 times
| |
|
angellovely213 Gà Con
Tổng số bài gửi : 3 Điểm Thưởng : 4561 Số lần được cám ơn : 1 Join date : 19/11/2011
| Tiêu đề: Re: Bài tập java Nhóm 6 đã làm (1.6, 2.11, 2.12) Sat Nov 19, 2011 3:35 pm | |
| | |
|