Создание и инициализация jagged-массива - C#
Формулировка задачи:
Добрый день, вечер!
Хожу на курсы по Си шарп, прошли тему массивы, вроде все понятно, а на деле дали практическое задание и тут калапс!!! Два дня читаю и ничего не могу понять:
а) может я не правильно понимаю задание
б) может я действительно чего-то не допонял!!
не могу понять как взаимодействовать в одном файле с:enum, struct, array
Очень прошу наставить на путь истенный, не ищу решения, ищу подсказку!!!
Не могу понять что надо сделать в пункте 3,4,5!!! Все остальное вроде понятно!
Заранее спасибо, извините если туплю!
Собственно само задание:
Основное условие:
class Program
{
// 1) declare enum ComputerType
enum ComputersType
{
Desktop = 0,
Laptop = 1,
Server = 2,
}
// 2) declare struct Computer
struct Computer
{
public ComputersType comp;
public int CPU;
public float HGz;
public int memory;
public int HDD;
}
static void Main(string[] args)
{
// 3) declare jagged array of computers size 4 (4 departments)
// 4) set the size of every array in jagged array (number of computers)
// 5) initialize array
// Note: use loops and if-else statements
// 6) count total number of every type of computers
// 7) count total number of all computers
// Note: use loops and if-else statements
// Note: use the same loop for 6) and 7)
// 8) find computer with the largest storage (HDD) -
// compare HHD of every computer between each other;
// find position of this computer in array (indexes)
// Note: use loops and if-else statements
// 9) find computer with the lowest productivity (CPU and memory) -
// compare CPU and memory of every computer between each other;
// find position of this computer in array (indexes)
// Note: use loops and if-else statements
// Note: use logical oerators in statement conditions
// 10) make desktop upgrade: change memory up to 8
// change value of memory to 8 for every desktop. Don't do it for other computers
// Note: use loops and if-else statementsРешение задачи: «Создание и инициализация jagged-массива»
textual
Листинг программы
var departmentComputers = new Computer[4][];