مساعده لاسايمنت جافا ...اكتب برنامج جافا للتحقق من صحة كلمة مرور
منتدى مصر التقني :: قسم لغات البرمجة Programming languages :: لغة الجافا Java :: نقاش و أستفسارات الاعضاء
صفحة 1 من اصل 1 • شاطر
مساعده لاسايمنت جافا ...اكتب برنامج جافا للتحقق من صحة كلمة مرور
لو سمحتو اريد مساعده في اسايمنت الجافا عليه ٥٠ درجه حرام اخسرهم ... و التسليم بكرهه
هذا احد الاسئله
The University is planning to have an online exam. To be sure that the student has a strong code to
login they are planning to develop a set of rules to generate the code for the student.
The developer has designed a few rules for the code. Help him to write the Java program that can
generate the code.
1) The code must not exceed 6 characters. [2]
2) The first two characters of the code must be the first two characters of the student’s id.
[Hint: Read the student’s id first.] [3]
3) The next two characters must be any two digits. [2]
4) The last two characters must be any two special characters from the list (#, $, @). [2]
5) If any one of the rules is not satisfied, prompt the user to generate the code again. [2]
6) If all the rules are satisfied then display a “Code Generated” message. [1]
هذا احد الاسئله
The University is planning to have an online exam. To be sure that the student has a strong code to
login they are planning to develop a set of rules to generate the code for the student.
The developer has designed a few rules for the code. Help him to write the Java program that can
generate the code.
1) The code must not exceed 6 characters. [2]
2) The first two characters of the code must be the first two characters of the student’s id.
[Hint: Read the student’s id first.] [3]
3) The next two characters must be any two digits. [2]
4) The last two characters must be any two special characters from the list (#, $, @). [2]
5) If any one of the rules is not satisfied, prompt the user to generate the code again. [2]
6) If all the rules are satisfied then display a “Code Generated” message. [1]
عدل سابقا من قبل أحمد مناع في الأحد مايو 10, 2020 8:40 pm عدل 2 مرات (السبب : وضع عناوان مناسب للمشاركة حتى لا يختلط الامر بين الاعضاء)
Soha- ..
- تاريخ التسجيل : 09/05/2020
المساهمات : 17
النقاط : 29
التقيم : 0
الدولة :
الجنس :
رد: مساعده لاسايمنت جافا ...اكتب برنامج جافا للتحقق من صحة كلمة مرور
حليت السؤال الثاني الخاص ب قروض شركة BAC Co وجدته محذوف
- الكود:
import java.util.Scanner;
public class samples {
String name;
String id;
int prop;
public samples(){}
public samples(String id, String name,int prop) {
this.id=id;
this.name=name;
this.prop=prop;
}
// طريقتين لتعين و ارجاع اسم الموظف
public void setName(String s) {
this.name= s;
}
public String getName() {
return this.name ;
}
// طريقتين لتعين و ارجاع معرف الموظف
public void setID(String s) {
this.id= s;
}
public String getID() {
return this.id ;
}
//طريقين لتعين و ارجاع عدد المقترحات
public void setProposalsNo(int No) {
this.prop= No;
}
public int getProposalsNo() {
return this.prop ;
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Input Number of samples:");
int n = Integer.parseInt(in.nextLine().trim());
samples[] sarry = new samples[n];
System.out.println("Input Employee ID, Name, number of proposals.:");
samples s = new samples();
for (int i = 0; i < n; i ++) {
s.setID(in.next()) ;
s.setName(in.next());
s.setProposalsNo(in.nextInt());
sarry[i]=s;
System.out.println(sarry[i].id + " " + sarry[i].getName()+" "+sarry[i].getProposalsNo());
}
in.close();
}
}
ـــــــــــــــــــ التوقيع ــــــــــــــــــــ
NEXT- الادارة
- تاريخ التسجيل : 18/02/2011
المساهمات : 446
النقاط : 200660
التقيم : 28
الدولة :
الجنس :
رد: مساعده لاسايمنت جافا ...اكتب برنامج جافا للتحقق من صحة كلمة مرور
شكرا استاذ لو سمحت شوف آخر سؤال تبع الباسورد ما دارسينه و عليه 12 درجه
Soha- ..
- تاريخ التسجيل : 09/05/2020
المساهمات : 17
النقاط : 29
التقيم : 0
الدولة :
الجنس :
رد: مساعده لاسايمنت جافا ...اكتب برنامج جافا للتحقق من صحة كلمة مرور
لو سمحتو احد يساعدني لازم اسلمه قبل س 12am
Soha- ..
- تاريخ التسجيل : 09/05/2020
المساهمات : 17
النقاط : 29
التقيم : 0
الدولة :
الجنس :
رد: مساعده لاسايمنت جافا ...اكتب برنامج جافا للتحقق من صحة كلمة مرور
Soha كتب:لو سمحتو اريد مساعده في اسايمنت الجافا عليه ٥٠ درجه حرام اخسرهم ... و التسليم بكرهه
هذا احد الاسئله
The University is planning to have an online exam. To be sure that the student has a strong code to
login they are planning to develop a set of rules to generate the code for the student.
The developer has designed a few rules for the code. Help him to write the Java program that can
generate the code.
1) The code must not exceed 6 characters. [2]
2) The first two characters of the code must be the first two characters of the student’s id.
[Hint: Read the student’s id first.] [3]
3) The next two characters must be any two digits. [2]
4) The last two characters must be any two special characters from the list (#, $, @). [2]
5) If any one of the rules is not satisfied, prompt the user to generate the code again. [2]
6) If all the rules are satisfied then display a “Code Generated” message. [1]
الحل على النحو التالى :
- الكود:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String a = sc.next();
int d = 0;
if (a.length() <= 6) {
if (a.contains("#") || a.contains("@") || a.contains("$")) {
char c = a.charAt(0);
if (Character.isAlphabetic(c)) {
char dd = a.charAt(a.length() - 2);
if ( (Character.isDigit(dd)))
{
if (a.matches(".*[0-9]{1,}.*")
|| a.matches(".*[a-zA-Z]{1,}.*")) {
System.out.println("The code was created successfully");
} else{
System.out.println("Not Valid1");
}
} else{
System.out.println("The first two characters of the code must be the first two characters of the student’s id.");
}
}
else{
System.out.println("Not Valid");
}
} else{
System.out.println("The last two characters must be any two special characters from the list (#, $, @)");
}
} else{
System.out.println("The code must not exceed 6 characters.");
System.out.println("generate the code again");
}
}
}
ـــــــــــــــــــ التوقيع ــــــــــــــــــــ
NEXT- الادارة
- تاريخ التسجيل : 18/02/2011
المساهمات : 446
النقاط : 200660
التقيم : 28
الدولة :
الجنس :
رد: مساعده لاسايمنت جافا ...اكتب برنامج جافا للتحقق من صحة كلمة مرور
_يرجي ملاحظة أن الاتى :
1_طلب ان يكون كلمة المرو أقل من 6 أحرف...تم تفعيل هذه القاعدة
2_أن يكون اول رقمين من معرف الطالب ....لم يتم التفعيل
3_أن يكون الحرفين التالين فى كلمة المرور أرقام ....تم التفعيل
4_أن يحتوى كلمة المرور أحرف خاصة * $ @ ...تم تعفيل هذه القاعدة
5_في حالة عدم استيفاء أي من القواعد ، اطلب من المستخدم إنشاء الرمز مرة أخرى.....تم التفعيل
6_ إذا تم استيفاء جميع القواعد ، فقم بعرض رسالة "تم إنشاء الرمز"...تم التفعيل
اذا يوجد مطلوب واحد فقط لم يتم انجازة وذلك لان وقت الافطار قد حان ربما اعاود العمل فى هذا المطلوب
1_طلب ان يكون كلمة المرو أقل من 6 أحرف...تم تفعيل هذه القاعدة
2_أن يكون اول رقمين من معرف الطالب ....لم يتم التفعيل
3_أن يكون الحرفين التالين فى كلمة المرور أرقام ....تم التفعيل
4_أن يحتوى كلمة المرور أحرف خاصة * $ @ ...تم تعفيل هذه القاعدة
5_في حالة عدم استيفاء أي من القواعد ، اطلب من المستخدم إنشاء الرمز مرة أخرى.....تم التفعيل
6_ إذا تم استيفاء جميع القواعد ، فقم بعرض رسالة "تم إنشاء الرمز"...تم التفعيل
اذا يوجد مطلوب واحد فقط لم يتم انجازة وذلك لان وقت الافطار قد حان ربما اعاود العمل فى هذا المطلوب
ـــــــــــــــــــ التوقيع ــــــــــــــــــــ
NEXT- الادارة
- تاريخ التسجيل : 18/02/2011
المساهمات : 446
النقاط : 200660
التقيم : 28
الدولة :
الجنس :
| |
منتدى مصر التقني :: قسم لغات البرمجة Programming languages :: لغة الجافا Java :: نقاش و أستفسارات الاعضاء
صفحة 1 من اصل 1
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى
الخميس أبريل 25, 2024 8:56 pm من طرف moslema_r
» شركة مكافحة حشرات في راس الخيمة
الخميس أبريل 25, 2024 8:34 pm من طرف moslema_r
» تطبيقIncogniton لإدارة ملفات تعريف متعددة للمتصفح
الأربعاء أبريل 24, 2024 3:51 pm من طرف زاكااا
» افضل شركة مكافحة النمل الابيض بالرياض
الإثنين أبريل 22, 2024 9:41 pm من طرف moslema_r
» Exemplary Сasual Dating - Verified Women
الخميس أبريل 18, 2024 9:18 pm من طرف wdqwd
» رش الدفان بالرياض
الخميس أبريل 18, 2024 7:11 pm من طرف moslema_r
» شركة تنظيف خزانات الشارقة
الخميس أبريل 18, 2024 6:57 pm من طرف moslema_r
» شركة مكافحة الفئران بالرياض
الإثنين أبريل 15, 2024 8:23 pm من طرف moslema_r
» افضل شركة كشف تسربات المياه بالباحة
الخميس أبريل 04, 2024 7:02 am من طرف gmalnagy
» ساعدوني وفهموني help me
الجمعة مارس 29, 2024 8:37 am من طرف linesoft