CJCoding With Joseph
15free / daySign inCreate account

Completing the main() Function

Assignment 1 - Movie1 - SM 25

What does main() already do?

You're already given a strong starting point. It:

  • Sets up the titles and years arrays

  • Collects movie input from the user

  • Uses "done" to stop the input loop

  • Creates space to eventually call resize(), sort(), and search_and_report()

  • Cleans up memory at the end

All that’s left is to:

  1. Add a call to resize() when the array is full

  2. Call the sort() function after input is complete

  3. Run both searches using search_and_report() inside the search loop

Keep reading this lesson

You've reached the end of the free preview. Unlock the rest of this lesson plus 27 more lessons in University of Lethbridge - CPSC.

  • Unlimited coding questions
  • Unlimited access to all classroom material
  • Weekly live call for questions and guidance
  • Mock exams marked by hand, with feedback
  • 3,000 AI tutor tokens / month
  • Personal SQL database (3 MB)
  • Progress tracking

Cancel anytime.