السلام عليكم .. حابه اشكركم ع الموضوع .. فكرته روعه
انا طالبه من خارج جامعتكم .. و تخصصي نظم معلومات مستوى اول ..
من سوء حظي نزلت مادة الجافا 1 بجدولي و توهقت .. بالبدايه كنت احس اني افهم بس
لما بدينا نتعمق بالماده فهيت .. خصوصاً لما اشوف اسئلة الكويز او الاسايمنت ما اعرف أحل ..
عندي اسايمنت فيه 5 اسئله و مطلوب اني اسلمه يوم الاحد .. و انا متوهقه من 4 ايام و انا احاول فيه
و خصوصاً اني مو فاهمه شي .. مدري وش المطلوب بالضبط -_-
اتمنى أحد يقدر يحله لي و يشرحه لي اذا ما عليكم أمر << ادري وقت اختبارات و حوسه بس ساعدوني :"(
Q1:Write a java program called
ExtractingDigits to extract all digits from an integer numers, in the revers order. For example, if the integer is 1542, the output shall be"2,4,5,1",with commas se[rating the digits.Integer numbers are enterd by the user.
Hints:Use n%10 to extract s digit;and n=n/10 to discard the last digits.
Q2:Write a java program called
ReversString,which asks the user to enter a String,and revers the order of the characters in that string in the output.The output should look like:
Enter a String:abcdef
The revers of String"abcdef" is "fedcba".
Q3:Write a java program called
PrintTringles to print the following patternusing
nested-loops in a class called Tringles.Write the main()which prompts the user for the numRows and prints all patterns.
1
1 2 1
1 2 4 2 1
1 2 4 8 4 2 1
1 2 4 8 16 8 4 2 1
1 2 4 8 16 32 16 8 4 2 1
1 2 4 8 16 32 64 32 16 8 4 2 1
1 2 4 8 16 32 64 128 64 32 16 8 4 2 1
(a) PowerOf2Triangle
Q4;Write a method called is
Perfect(int posInt)that takes a postive integer,and return true if the number is perfect.Similary,write a method called is
Deficient(int posInt) to check for deficient numbers.
Using the methods,write a java program called
PerfectNumberList that prompts user for an upper bound ( a postive integer ),and lists all the perfect numbers less than or equal to this upper bound.It shall also list all the numbers that are neither deficient nor perfect.The output should look like:
Enter the upper bound:1000
These numbers are perfect:6 28 496
3 perfect numbers found (0.30%)
These numbers are neither deficient nor perfect:12 18 20 24 30 36 40 42 48 54 56 60 66 70 72 78 80.....
246 numbers found (24.60%)
السؤال الخامس بحاول احله بنفسي و اذا ما عرفت بنزله لكم هنا .. و شكرا مقدماً