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[6] == "Game") videoCard = new GameVideoCard(args[7], int.Parse(args[8]), int.Parse(args[9]), decimal.Parse(args[10]));
- else if (args[6] == "Mine") videoCard = new MineVideoCard(args[7], int.Parse(args[8]), int.Parse(args[9]), decimal.Parse(args[10]));
- else return "Invalid type video card!";
- if (user.Money < processor.Price + videoCard.Price) return $"User: {args[0]} - insufficient funds!";
- user.Computer=new Computer(processor, videoCard, int.Parse(args[11]));
- return $"Successfully created computer for user: {args[1]}!";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement