Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Processor processor;
- VideoCard videoCard;
- if (users.Count(x => x.Name == args[1]) == 0) return $"Username: {args[0]} does not exist!";
- User user = users.FirstOrDefault(x => x.Name == args[1]);
- if (args[2] == "Low") processor = new LowPerformanceProcessor(args[3], int.Parse(args[4]), decimal.Parse(args[5]));
- else if (args[2] == "High") processor = new HighPerformanceProcessor(args[3], int.Parse(args[4]), decimal.Parse(args[5]));
- else return "Invalid type processor!";
- if (args[5] == "Game") videoCard = new GameVideoCard(args[6], int.Parse(args[7]), int.Parse(args[8]), decimal.Parse(args[9]));
- else if (args[5] == "Mine") videoCard = new MineVideoCard(args[6], int.Parse(args[7]), int.Parse(args[8]), decimal.Parse(args[9]));
- else return "Invalid type video card!";
- if (user.Money < processor.Price + videoCard.Price) return $"User: {args[0]} - insufficient funds!";
- Computer computer = new Computer(processor, videoCard, int.Parse(args[8]));
- return $"Successfully created computer for user: {args[1]}!";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement