Skip to content

Instantly share code, notes, and snippets.

@ryanorsinger
Created November 30, 2018 15:47
Show Gist options
  • Save ryanorsinger/3234de78dee7327264a86a37785610e9 to your computer and use it in GitHub Desktop.
Save ryanorsinger/3234de78dee7327264a86a37785610e9 to your computer and use it in GitHub Desktop.
JavaScript sales report exercise w/ string and array manipulation
// Output should include:
// - total number of employees
// - total number of units sold
// - avg units sold per employee
// - Then output should share employee production, ordered from highest to lowest # of units
// * Units | Full Name | Employee Number
// * 5 Bob Boberson 2
var reportContents = "Monthly Sales Report\nDate: 03-17-2015\nOffice: Codeup\n ===================================================\nEmployee Number, First Name, Last Name, Sales Units\n***************************************************\n\n1, Jane, Janeway, 3\n3, Tricia, Triciason, 5\n4, Jeannette, Jeanson, 4\n5, Charles Emmerson III, Winchester, 2\n6, Chet, Chedderson, 8\n7, Chaiam, Chaiamson, 12\n8, Dale, Dalesinger, 1\n9, Zig, Ziglar, 50\n10, Henry, Kissinger, 1\n11, Arthur Herbert, Fonzarelli, 23\n12, Betty, Boop, 67";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment