Skip to content

[SP_1] [Session 2] Practice Task: C# Fundamentals Part 2 (Loops β†’ Error Handling)Β #2

Description

@alyamama21

##Original Issue Link:
SparkToCode2026/SparkToCode2026_CourseHub#2

πŸ“… Session Info

  • Batch: Spark to Code 2026
  • Session: Session 2 – C# Fundamentals Part 2
  • Topics Covered: for loop, while loop, do-while loop, try-catch (syntax / runtime / logical errors)

🎯 Task

Solve all 10 problems from the attached practice task sheet (PDF) in a single Console Application. Each problem must be written and tested independently before moving to the next.

πŸ“Ž Task Sheet:

CSharp_Fundamentals_Part2_Practice_Tasks.pdf

⚠️ Scope Reminder

Use ONLY what has been taught so far (Session 1 + Session 2). Do not use foreach, nested loops, arrays/collections, functions/methods other than Main, const/readonly, XML doc comments, object, or classes other than the default Program class.

βœ… Deliverables

Easy (4)

  • Task 1 – Countdown Timer
  • Task 2 – Sum of Numbers 1 to N
  • Task 3 – Multiplication Table
  • Task 4 – Password Retry

Medium (4)

  • Task 5 – Number Guessing Game
  • Task 6 – Safe Division Calculator
  • Task 7 – Repeating Menu with Exit Option
  • Task 8 – Sum of Even Numbers Only

Hard (1)

  • Task 9 – Validated Positive Number Input

Advanced (1)

  • Task 10 – Simple ATM Simulation

πŸ§ͺ Self-Check Before Submission

  • Code compiles with zero errors and zero warnings
  • Every task tested with at least one valid and one invalid/edge-case input
  • try-catch tasks tested with a non-numeric input to confirm the catch block actually fires
  • Loop-based tasks tested with a boundary value (e.g. N = 1, N = 0)
  • Output format matches what's described in each task
  • Submitted via GitHub repo

Sprint: Sprint 1 – Session 2
Labels: assignment, sprint-1, csharp-fundamentals, session-2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions