If Miguel is writing to the principal to persuade him why vending machines should be used during the school day, it should be formal. This is because the principal has an important position and is more likely to consider your opinion if you write to him/her formally.
Brody should also write formally because his boss is an important figure and especially with work, you definitely want to be professional.
Jessica can write informally because her sister isn’t a professional person she needs to address in that way. Jessica is just writing a reminder, not a letter.
And finally, Rihanna can be informal because she’s writing to a friend. Her friend most likely doesn’t care about how professional the letter sounds; she just wants to know what Rihanna did over summer break.
Hope this helps! \(^•^)/