http://www.nextbus.com/xmlFeedDocs/NextBusXMLFeed.pdf
http://webservices.nextbus.com/service/publicXMLFeed?command=agencyList
Obtain a list of available transit agencies.
| START | |
| SET "state" = "green" | |
| SET "isAdvanceActive" = "true" | |
| SET "timer" = 40 and begin auto-decrement | |
| ## Get current time | |
| GET "timer" value | |
| ## Check if 4-light/5-states system is active |
| #include <stdio.h> | |
| struct employee { | |
| int empId; | |
| float salary; | |
| }; | |
| int main(void) { | |
| int i; | |
| float total_salary = 0.0; |
| 1. Import the standard input and output library | |
| 2. Import the String helper library | |
| 3. Define a macro called SZ and set it to 31 | |
| 4. declare a character array of size "SZ" (31) called "str1" and set it to "Charlotte's" | |
| 5. declare a character array of size "SZ" (31) called "str2" and set it to "Spider's web" | |
| 6. declare a character array of size "SZ" (31) called "str3" and initialize it with one item: 0 | |
| 7. Concatenate the value of str1 and the address of the value at index 9 in the str2 array using the strcat method provided by the string helper library | |
| 8. Compare the value of str1 with "Charlotte's web" using the strcmp method. | |
| 9. If the result from step 8 is false, execute the contents in the if block (since the condition is prepend with the not (!) operator ): copy the string "is the" to the value of str3 | |
| 10. If the result from step 8 is true, execute the contents in the else block (since the condition is prepend with the not (!) operator ): copy the string "is not the" to the value of str3 |
| ----------------------------------------------BUGS---------------------------------------------- | |
| ======== BUG 1 ======== | |
| Original Line: 13, 16 | |
| Issue: Case-sensitive comparision of characters | |
| What was done: Used the "tolower" function from the ctype library to convert both the characters being compared to lowercase | |
| Original Code: |
| 1: Import the Standard Input Output library | |
| 3,4,5,6: Define four macros: | |
| a. MAX_JUDGES | |
| b. MAX_STRING | |
| c. MAX_CONTESTANTS | |
| d. WINNER_CUTOFF | |
| 8. Declare a struct called "Score" with the following datatypes: | |
| a. "judgeScore": an array of doubles with a maximum capacity of 3 | |
| 13. Declare a struct called "Contestant" with the following datatypes: | |
| a. "name": an array of characters with a maximum capacity of 25 |
http://www.nextbus.com/xmlFeedDocs/NextBusXMLFeed.pdf
http://webservices.nextbus.com/service/publicXMLFeed?command=agencyList
Obtain a list of available transit agencies.
| [ | |
| { | |
| "admin_name" : "Tōkyō", | |
| "capital" : "primary", | |
| "city" : "Tokyo", | |
| "city_ascii" : "Tokyo", | |
| "country" : "Japan", | |
| "id" : "1392685764", | |
| "iso2" : "JP", | |
| "iso3" : "JPN", |
| /** | |
| * @desc Day 5: Supply Stacks | |
| * Expedition can depart once final supplies have been unloaded from ships | |
| * Supplies are stored in stacks of marked crates and need to be rearranged | |
| * Ship has cargo crane to move crates between stacks in planned steps | |
| * Elves have a drawing of the starting stacks and rearrangement procedure | |
| * Elves want to know which crate will be on top of each stack after rearrangement | |
| * In example, top crates are C in stack 1, M in stack 2, and Z in stack 3 | |
| * Elves need to know which crate ends up on top of each stack | |
| * |
| interface TreeNode { | |
| capacity: number; | |
| children: TreeNode[]; | |
| } | |
| const findAverage = (node: TreeNode): number => { | |
| let sum: number = 0, | |
| count: number = 0; | |
| let traverse = (node: TreeNode): void => { |
Imagine a sophisticated hierarchical data structure in JavaScript that models an organization's intricacies, encompassing details such as employee ID, name, position, department, and subordinates. Your task is to design a function, getEmployeesByPosition(organization, position) ( starting code is provided below ), which takes this organizational data structure as input along with a position ( e.g “Software Engineer” ) and efficiently produces an array containing information about all employees holding the given position within the organization. Your implementation should seamlessly navigate the complexity of the hierarchical data and deliver a clear and concise result. Either use JSPlayground as your environment or any online editor that you're comfortable with.
const organization = {
id: 1,
name: "Company",
type: "Organization",
employees: [