انتقل إلى المحتوى
أمين أبوزيد
BEG-016

حل المشكلات

  • 6 درس
  • 71 دقيقة قراءة
  • 5 ساعة تدريب (تقدير)
في هذه الصفحة 8 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • التجزئة (Decomposition)
  • الشيفرة الزائفة (pseudocode)
  • المخططات الانسيابية
  • التتبّع
  • تصحيح الأخطاء (debugging)
  • الحالات الحدّية

تعلّم أولًا

71 دقيقة قراءة · 5 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Restate a problem in their own words and identify inputs, outputs, and constraints.
  2. Decompose a problem into steps and express them as pseudocode or a flowchart before coding.
  3. Trace a program by hand with a variable table.
  4. List edge cases (empty, one element, maximum, negative, invalid) before writing code.

الدروس

  1. 01افهم المشكلة أولاً12 د قراءة
  2. 02التجزئة (Decomposition)12 د قراءة
  3. 03الشيفرة الزائفة والمخططات الانسيابية12 د قراءة
  4. 04التتبّع اليدوي بجدول المتغيرات12 د قراءة
  5. 05التفكير بالحالات الحدّية12 د قراءة
  6. 06عرض عملي: التخطيط قبل الكود على مشكلة جديدة11 د قراءة

المختبر والتمارين

Lab

BEG-016-LAB1 · Plan before code

Outcomes: 1–4 · Time: ~3 h For each of three unseen problems (supplied by the instructor, for example: second largest value, palindrome check, count vowels):

  1. Restate the problem and list inputs, outputs, constraints.
  2. Write pseudocode or a flowchart.
  3. List edge cases with expected results.
  4. Hand-trace one example with a variable table.
  5. Only then write the Java code and submit the plan with it.

Acceptance: plan and code match; all listed edge cases handled.

Exercises (assessment: one unseen problem solved with a plan, graded on the plan as much as the code)

IDOutcomeTask
BEG-016-EX011Restate "give each customer a loyalty discount" and list inputs, outputs, and three questions to ask.
BEG-016-EX022Decompose "print a report of the highest-scoring student" into 5 steps.
BEG-016-EX032Write pseudocode for "is a number prime?" and draw its flowchart.
BEG-016-EX043Trace int x = 10; int c = 0; while (x > 1) { x = x / 2; c++; } with a variable table.
BEG-016-EX054List at least six edge cases for "average of an array of grades".
أظهر الحلول
  • EX01 Inputs: customer data, purchase history. Output: discount percent. Questions: what makes a customer loyal? maximum discount? can discounts stack?
  • EX02 1 read the scores; 2 start the best at the first student; 3 compare each other student; 4 update the best; 5 print the name and score.
  • EX03 If n < 2 not prime; for d from 2 up to the square root of n, if n % d == 0 then not prime; otherwise prime. The flowchart has one decision diamond for each test.
  • EX04 Rows: x 10, c 0 → x 5, c 1 → x 2, c 2 → x 1, c 3; the loop ends. Final c is 3.
  • EX05 Empty array; one grade; all equal; zero grades; negative or above 100 (invalid); very large array; decimals.
  • Lab acceptance and the graded unseen problem cover the full routine (outcomes 1-4 together).

الاختبار

Outcomes: O1 understand the problem · O2 decompose and plan · O3 hand-trace · O4 edge cases.

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  1. 1The first step in solving a problem is to:O1
  2. 2Which is NOT one of inputs, outputs, constraints?O1
  3. 3Decomposition means:O2
  4. 4Pseudocode is:O2
  5. 5In a flowchart a yes/no decision is drawn as a:O2
  6. 6A variable table is used to:O3
  7. 7In hand-tracing, the bug is usually at:O3
  8. 8Which is an edge case for "largest in an array"?O4
  9. 9Testing only the happy path:O4
  10. 10Which pair are both edge cases?O4

الجزء العملي

The graded unseen problem (plan first, then code) and the three-problem lab. Pass: plan and code match, edge cases listed before coding and all handled, and quiz at least 8/10.

أخطاء شائعة

Coding before understanding; testing only the happy path.

التقييم

Unseen problem solved with a plan, graded on the plan as much as the code.

الصلة بالمسار الوظيفي

The habit behind requirement clarification (MID-064) and requirements engineering (SRC-001).

اكتب للبحث في المستويات والمراحل والوحدات والدروس.