Mikaeldef
Mikaeldef
CC#
Created by Mikaeldef on 11/24/2023 in #help
Can I add elements to an array while running the code?
Hi there! Bashing my head in with my beginner C# assignment. From the instructions they want us to Create a program that allows the user to select these options via a menu.
- Enter the name and age of a user-defined number of family members. - Print the stored family members in the console - Print the sum of the ages of the added family members - Print the average age of the added family members in the console o The average age should be printed to two decimal places, for example, 37.29. - Be able to choose to exit the program The data entered by the user should be stored using appropriate data types and data structures. In this assignment, you should also use an array to store the names of the family members and an array to store the ages.
The problem I'm having is with the array part. From what I've seen on the internet a List would be better for this. Is there something I'm missing?
13 replies