عرض مشاركة واحدة
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 26-03-2010, 03:56 PM   #73

BeeroOo

جامعي

الصورة الرمزية BeeroOo

 
تاريخ التسجيل: Dec 2009
التخصص: تقنية معلومات
نوع الدراسة: إنتظام
المستوى: الخامس
الجنس: أنثى
المشاركات: 77
افتراضي رد: تدرس / تدرسي java او++ c وعندك سؤال .. تعـال / تعالي هنا

السلام عليكم
ممكن الله يخليكم احد يشوف الكود دا صحيح مع العلم انو البرنامج عندي يعطيني انو العمليه اكتملت وبس ومايطلع لي ولا شي ولا كاني كتبت شي
import java.lang.*;
import java..*;
import java.util.*;
//..................................

public class Lap3 {

public static void main(String[] args) {
Scanner input=new Scanner(System.in);
String fullName,part1,x,y,z,space;
//...................................
Date d=new Date();
SimpleDateFormat sdf=new SimpleDateFormat("ddMMYYYY");
int date,r,a;
float f,s;
//...........................................
System.out.println("Enter your full name");
fullName=input.nextLine();
x=fullName.substring(1,2);
System.out.println(x);
//..................................
space=(" ");
fullName=fullName.substring(fullName.indexOf(space )+1,fullName.length());
y=fullName.substring(1,2);
System.out.println(y);
//............................
fullName=fullName.substring(fullName.indexOf(space )+1,fullName.length());
z=fullName.substring(1,2);
System.out.println(z);
//..................................................
System.out.println("the first part of the acount user Name will be :"+x+y+z+"\n");
System.out.println("the second part of the acount user Name will be:"+sdf.format(d));


//......................................
Random random=new Random();
r=random.nextInt(5)+1;
System.out.println("\n"+"\n"+"A random integer from 1 to 5 is:"+r);

//..............
f=Math.random();
System.out.println("\n"+"\n"+"A random float from 0 to 1 is:"+f);
//...........
DecimalFormat df=new DecimalFormat("0.000");
s=Math.pow(f,r);
System.out.println("\n"+"\n"+"A resault of raising the float number "+f+"to the integer number "+r+"is:"+s);
System.out.println("\n"+"\n"+"After round the number is:"+df.format(s));
//................
a=Math.abs(s);
System.out.println("\n"+"\n"+"abslut of the result is:"+a);
o=Math.ceil(s);
System.out.println("\n"+"\n"+" the result after round is:"+o);
System.out.println(".............................. .................\n\n"+x+y+z+"_"+sdf.format(d)+o+" \n");
}
}

 

توقيع BeeroOo  

 

 

BeeroOo غير متواجد حالياً   رد مع اقتباس