Advertisement
Guest User

Untitled

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