Advertisement
alberthrocks

Make that table!

May 29th, 2014
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. =====================
  2. = Make That Table! =
  3. =====================
  4. CHALLENGE:
  5. Using any programming language, write a program that takes the following INPUT and converts it into a valid table OUTPUT.
  6. Input represents any table, space-delimited. The first line is the table header, and the second line is the table secondary header.
  7.  
  8. Output must be based on the input. Display statements of the final result without any steps to get to the final results will be disqualified.
  9.  
  10. SPECIFICS:
  11. * Everything is right-justified and well spaced. A human can easily distinguish the columns.
  12. * Assume that there will always be a header (first line) and a sub-header (second line).
  13. * You can safely assume that every value cell (third line and down) will be filled.
  14. * There will always be rows of data, but consider only using the first few, since the actual
  15. data could be thousands of lines long.
  16. * As for output, the table I made was just a quickly done table to show how it could look like.
  17. The main goal of this challenge is to show that you are able to map the header and subheader
  18. to the column data below. Therefore, the output needs to show that you are successful in doing so.
  19. A simple table will do, or even a CSV that can easily be imported to Excel.
  20.  
  21. =======================================================================
  22. = INPUT: =
  23. =======================================================================
  24. Hoooligans! Party Animals Count Alpha_Delta Rounded First
  25. Second Third
  26. 1234 12.4562294932 12.4958 193583.149592983 28592 2948502.5
  27. 39502050 104.682950380298 193.499499 19384885444.2223 1234567 123592
  28.  
  29. =======================================================================
  30. = OUTPUT: =
  31. =======================================================================
  32. Hoooligans! | Party Animals Count | Alpha_Delta | Rounded | First |
  33. ===============================================================================================
  34. | | | | Second | Third
  35. -----------------------------------------------------------------------------------------------
  36. 1234 | 12.4562294932 | 12.4958 | 193583.149592983 | 28592 | 2948502.5
  37. 39502050 | 104.682950380298 | 193.499499 | 19384885444.2223 | 1234567 | 123592
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement