задача Google 80/100
Здравейте,
тази задача ми дава 80 от 100 и така и не успявам да си намеря грешката.
Някой ще може ли да погледне и да ми каже къде точно греша?
main - https://pastebin.com/C2gmQ9Wa
car - https://pastebin.com/Nrhhx0ex
children - https://pastebin.com/zycZywtC
company - https://pastebin.com/6Bb7gG4T
parents - https://pastebin.com/bm6fgnP0
person - https://pastebin.com/fBEnQ812
pokemon - https://pastebin.com/kTN936jb
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:
- "<Name> company <companyName> <department> <salary>"
- "<Name> pokemon <pokemonName> <pokemonType>"
- "<Name> parents <parentName> <parentBirthday>"
- "<Name> children <childName> <childBirthday>"
- "<Name> car <carModel> <carSpeed>"
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.
Note: print the information in format:
{personName}
Company:
{companyName} {companyDepartment} {salary}
...
Children:
{childName} {childBirthday}
{childName} {childBirthday}
Examples
Input |
Output |
PeshoPeshev company PeshInc Management 1000.00 TonchoTonchev car Trabant 30 PeshoPeshev pokemon Pikachu Electricity PeshoPeshev parents PoshoPeshev 22/02/1920 TonchoTonchev pokemon Electrode Electricity End TonchoTonchev |
TonchoTonchev Company: Car: Trabant 30 Pokemon: Electrode Electricity Parents: Children: |
JelioJelev pokemon Onyx Rock JelioJelev parents JeleJelev 13/03/1933 GoshoGoshev pokemon Moltres Fire JelioJelev company JeleInc Jelior 777.77 JelioJelev children PudingJelev 01/01/2001 StamatStamatov pokemon Blastoise Water JelioJelev car AudiA4 180 JelioJelev pokemon Charizard Fire End JelioJelev |
JelioJelev Company: JeleInc Jelior 777.77 Car: AudiA4 180 Pokemon: Onyx Rock Charizard Fire Parents: JeleJelev 13/03/1933 Children: PudingJelev 01/01/2001 |