البرمجة بالعراقي
Open in Telegram
هاي قناة سوينها ل طلاب علوم الحاسوب حتى نتعاون بيناتنا ونتعلم كل ما يتعلق بالبرمجة وايضا كلشي من ادوات ذكاء اصطناعي و مشاريع و بوتات رابط كروب مجموعة https://t.me/learn_javaaa
Show more833
Subscribers
No data24 hours
-57 days
-1330 days
Posts Archive
س ٤
ايجاد العنصر المتكرر
Scanner mu = new Scanner(System.in);
System.out.print("enter size of the array: ");
int n=mu.nextInt();
int a[]=new int[n];
for (int i = 0; i <n; i++) {
System.out.print("element - "+i+": ");
a[i]=mu.nextInt();
}
for (int i = 0; i <n; i++) {
for (int j = i+1; j <n; j++)
if(a[i]==a[j])
System.out.println("\n Total number of duplicate elements found in the array is : "+a[i]);
سؤال ٣
كذلك مصفوفة منفصلة جديدة للعناصر برايم اللي تقبل القسمة فقط ع 1 و نفس العدد
Scanner mu = new Scanner(System.in);
System.out.print("enter size of the array: ");
int n=mu.nextInt();
int a[]=new int[n];
for (int i = 0; i <n; i++) {
System.out.print("element - "+i+": ");
a[i]=mu.nextInt();
}
int prime[]=new int[n], k=0;
for (int i = 0; i <n; i++) {
boolean f=true;
for (int j = 2; j <a[i]; j++){
if(a[i]%j==0)
f=false;
}
if(f&&a[i]>1){
prime[k] = a[i]; k++;
}
}
System.out.println("\n new array is : ");
for (int i = 0; i <k; i++) {
System.out.print(prime[i]+" ");
}
سؤال ٢
مطلوب
نعمل مصفوفتين منفصلات وحده للعناصر الزوجيه والثانية للفردية
Scanner mu = new Scanner(System.in);
System.out.print("enter size of the array: ");
int n=mu.nextInt();
int a[]=new int[n];
for (int i = 0; i <n; i++) {
System.out.print("element - "+i+": ");
a[i]=mu.nextInt();
}
int even[]=new int[n], k=0;
int odd[]=new int[n], z=0;
for (int i = 0; i <n; i++) {
if(a[i]%2==0){
even[k] = a[i]; k++;
}
else {
odd[z] = a[i]; z++;
}
}
System.out.println("\n The Even elements are : ");
for (int i = 0; i <k; i++) {
System.out.print(even[i]+" ");
}
System.out.println("\n The Odd elements are : ");
for (int i = 0; i <z; i++) {
System.out.print(odd[i]+" ");
}
سؤال الاول المطلوب ادخال وطباعة عناصر المصفوفة
وبعدين طباعة العناصر بالعكس...
Scanner mu = new Scanner(System.in);
System.out.print("enter size of the array: ");
int n=mu.nextInt();
int a[]=new int[n];
for (int i = 0; i <n; i++) {
System.out.print("element - "+i+": ");
a[i]=mu.nextInt();
}
System.out.println("The values store into the array are : ");
for (int i = 0; i <n; i++)
System.out.println(a[i]);
System.out.println("The values store into the array in reverseare :");
for (int i = n-1; i >=0; i--)
System.out.println(a[i]);
package mu;
import java.util.*;
import java.time.LocalDate;
import java.time.Period;
public class Mu {
public static void main(String[] args) {
Scanner mu = new Scanner(System.in);
int birth;
System.out.print("enter year of ur birth: ");
birth= mu.nextInt();
System.out.print("enter month of ur birth: ");
int m= mu.nextInt();
System.out.print("enter day of ur birth: ");
int d= mu.nextInt();
LocalDate a=LocalDate.of(birth, m,d );
LocalDate now=LocalDate.now();
Period age =Period.between(a, now) ;
System.out.println("\n age = "+age.getYears() +"\n months = "+age.getMonths()+" \n days = "+age.getDays());
}
}
تحتاج مكتبتين لوكال تايم ومكتبة period
ودوال جاهزه من المكتبة
والتنفيذ مثل ما تشوف
هذا البرنامج بسيط رح ادزه اكثر تطور
يعني البرنامج يطلب منك تدخل مو بس مواليدك
يطلب تدخل الشهر واليوم كذلك
ويعطيك العمر وكم شهر ويوم بعد ميلادك
Scanner mu = new Scanner(System.in);
int age,birth;
System.out.print("enter ur birth: ");
birth= mu.nextInt();
age=2021 - birth;
int months=age*12;
int days=months*30;
System.out.println("\n age = "+age +"\n months = "+months+" \n days = "+days);
Learn Web Development for free👇
Notes 📃
→ w3 schools
→ Mdn docs
→ GeeksforGeeks
YouTube 🎥
→ Traversy Media
→ Web Dev Simplified
→ JavaScript Mastery
Website 🌐
→ freeCodeCamp
→ Codecademy
→ SoloLearn
Practice 💻
→ Frontend Mentor
→ TestDome
→ Create Projects
سويت حساب ب تويتر
وراح انشرلكم ثريدات عن برمجة وخصوصا جافا
فالي عنده تويتر خ يتابعني
موقع رهيب لتعلم البرمجة
اكثر من 100 ألف شخص قد حصلوا على وظائف مطورين في البرمجة بعد الانتهاء من هذهِ الدورات التدريبية –
--
هذا الموقع هو الافضل عالميا في البرمجة و طالما استفدت منه في رحلتي البرمجية
--
رابط الموقع
freecodecamp.org/learn/
هو كورس متكامل في لغة البرمجة جافا
الأن مجانا ولمدة 3 ايام عبر الرابط التالي:
udemy.com/course/otdejbu…
