Programming

  1. Provide a representation of the various types of loops
  2. Rewrite parts of your code from your project to apply a different loop type
  3. Show how you can test your code in your Program.cs ← Example Answer Not Included ❗

Question 1

Here are the main types of loops in C#:

Question 2

            // Example code of printing all bookings to the console
            foreach (Booking booking in bookingService.GetAllBookings())
            {
                string value = $"Booking Info: {booking.BookingID}, Name: {booking.UserID}, Animal: {booking.AnimalID}";
                Console.WriteLine(value);
            }

            // Example code of printing all booking to the console using a while-loop
            var bookings = bookingService.GetAllBookings();
            int index = 0;
            while (index < bookings.Count)
            {
                Booking booking = bookings[index];
                Console.WriteLine($"Booking Info: {booking.BookingID}, Name: {booking.UserID}, Animal: {booking.AnimalID}");
                index++;
            }

System Development

  1. What is the purpose of a sequence diagram
  2. Show how you would use a sequence diagram to describe the interactions between objects, which involve iterations
  3. Show how you would use a sequence diagram to describe the interactions between objects, which involve choices (alternatives)

Question 1

A sequence diagram is a UML (Unified Modeling Language) diagram that illustrates how different objects or components in a system interact with each other over time. It shows the sequence of messages exchanged between objects and the order in which these interactions occur.

It's particularly useful for visualizing the flow of operations in a system, including loops, conditions, and parallel processes, making it an essential tool for system design and documentation.