26-03-2010, 05:29 PM
|
#2
|
تاريخ التسجيل: Jul 2008
كلية: كلية الحاسبات وتقنية المعلومات
التخصص: IT
نوع الدراسة: عضو هيئة تدريس
المستوى: متخرج
البلد: جــــدة
الجنس: ذكر
المشاركات: 2,477
|
رد: طلب من Mr.Ahmad تصحيح للكود
وعليكم السلام ورحمة الله وبركاته .
كود PHP:
import java..*; import java.lang.*; import java.util.*; public class HW2 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String fullName, first, rest1, rest, a, b, c; System.out.print("Enter your full name : "); fullName = scanner.nextLine(); a = fullName.substring(1, 2); rest1 = fullName.substring(fullName.indexOf(" ") + 1, fullName.length()); b = rest1.substring(1, 2); rest = rest1.substring(rest1.indexOf(" ") + 1, rest1.length()); c = rest.substring(1, 2); System.out.println("The first part of account user Name will be : " + a + b + c); // date Date today; today = new Date(); SimpleDateFormat sdf; sdf = new SimpleDateFormat("ddMMyyyy"); System.out.println("The second part of the account user name will be : " + sdf.format(today)); // random Random random = new Random(); int ra = random.nextInt(5) + 1; System.out.println("A random integer from 1 to 5 is " + ra); float rf = random.nextFloat(); System.out.println("A random float from 0.0 to 1.0 is " + rf); } }
بالتوفيق
|
|
سبحان الله وبحمد ,,, سبحان الله العظيم الحمد لله كما ينبغي لجلال وجهه وعظيم سلطانه . اللهم صل على محمد وعلى آل محمد كما صليت على إبراهيم وعلى آل إبراهيم إنك حميد مجيد . اللهم بارك على محمد وعلى آل محمد كما باركت على إبراهيم وعلى آل إبراهيم إنك حميد مجيد.
|
|
|
|