Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. Google
  2. Google is always watching you, so it should come as no surprise that they know everything about you (even your pokemon collection), since you’re a really good at writing classes Google asked you to design a Class that can hold all the information they need for people.
  3. From the console you will receive an unkown amount of lines until the command "End" is red, on each of those lines there will be information about a person in one of the following formats:
  4. "<Name> company <companyName> <department> <salary>"
  5. "<Name> pokemon <pokemonName> <pokemonType>"
  6. "<Name> parents <parentName> <parentBirthday>"
  7. "<Name> children <childName> <childBirthday>"
  8. "<Name> car <carModel> <carSpeed>"
  9. You should structure all information about a person in a class with nested subclasses. People names are unique - there won't be 2 people with the same name, a person can also have only 1 company and car, but can have multiple parents, children and pokemons. After the command "End" is received on the next line you will receive a single name, you should print all information about that person. Note that information can change during the input, for instance if we receive multiple lines which specify a person company, only the last one should be the one remembered. The salary must be formated to two decimal places after the seperator.
  10. Note: print the information in format:
  11. {personName}
  12. Company:
  13. {companyName} {companyDepartment} {salary}
  14. ...
  15. Children:
  16. {childName} {childBirthday}
  17. {childName} {childBirthday}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement