CP4P_SDLC_Activity_Answers

.docx

School

Seneca College *

*We aren’t endorsed by this school

Course

101

Subject

Computer Science

Date

Apr 3, 2024

Type

docx

Pages

6

Uploaded by SargentWater35178

Report
Computer Principles for Programmers APIs, SDLC, Version Control Using Mozilla Firefox is strongly recommended for this Activity because it can transform JSON responses into a human readable format. (Raw Data > "Pretty Print") (#) is points for API and Time Zone questions. 1. (5) What is sent via the API from one system to another? What is sent back? API sends: API stands for Application programming interface and allows different systems to communicate and interact with each other. One system sends a request to another system with API. This request includes specific information such as the request method, header, parameters, and body. Request methods can be GET, POST, PUT, DELETE, etc., and headers include metadata for the request. Parameters are additional data values sent along with the request to provide specific instructions. The body contains the main data, and it usually is in a structured format like JSON or XML. Sent back: When a system receives the API request, processes it, and generates a response to it. This response includes the status code, headers, and a body/payload. The status code is a number that shows the outcome of the request. For example, 200 means a successful request or 500 for server error. The header provides metadata about the response like content type, and authentication-related information. And body contains the actual data or message that is sent back as a response. 2. (5) Use api.agify.io to predict the age of a person using your given name and an ISO country code API URL request: https://api.agify.io/?name=Faeze&country_id=IR JSON response: { "count": 86, "name": "Faeze", "age": 37, "country_id": "IR" } 3. (5) Use the time zone API request at worldtimeapi.org API URL request: http://worldtimeapi.org/api/timezone/America/Regina JSON response: { "abbreviation": "CST", "client_ip": "2607:fea8:3a9f:af70:bc47:ed72:e5d5:ca38", "datetime": "2023-07-15T20:13:33.588872-06:00", "day_of_week": 6, "day_of_year": 196, "dst": false, "dst_from": null, "dst_offset": 0, "dst_until": null, "raw_offset": -21600, "timezone": "America/Regina", "unixtime": 1689473613, CPR101 Summer 2023 Week 9 Page 1 of 6
Computer Principles for Programmers APIs, SDLC, Version Control "utc_datetime": "2023-07-16T02:13:33.588872+00:00", "utc_offset": "-06:00", "week_number": 28 } 4. (16) Using the above JSON data from worldtimeapi.org, fill in the JSON key / value pairs relating to the descriptions in the table below. See Response Schema JSON key JSON value UTC date/time in ISO8601 format utc_datetime 2023-07- 16T02:13:33.588872+00:00 Unix UTC timestamp unixtime 1689473613 Unix UTC to location difference utc_offset -06:00 Location's daylight-saving time difference dst false Location date/time in ISO8601 format datetime 2023-07-15T20:13:33.588872-06:00 How do you calculate the location's timestamp from the UTC timestamp using JSON keys? For converting the UTC timestamp to the location's timestamp, we add the raw offset to the UTC timestamp. In this case, the raw offset is -21600 seconds (-06:00 hours). UTC timestamp: 1689473613 Raw offset: -21600 seconds Unix UTC timestamp - Raw offset: 1689473613 + (-21600) = 1689452013 Calculated location timestamp value is: 1689452013 5. (5) How did you confirm that your location timestamp when converted to data/time was the same as the Location date/time in ISO8601 format in the JSON schema? Show your test and the result. CPR101 Summer 2023 Week 9 Page 2 of 6
Computer Principles for Programmers APIs, SDLC, Version Control SDLC – Software Development Life Cycle 54 points = 9 points × 6 items, 75+ words each Determine : First, I try to read and understand the assignment specification of the IPC class. For understanding, I read the instruction carefully including any accompanying materials or guidelines. I try to take note of any specific instructions or constraints mentioned like required language, or library. After that, I try to identify key requirements and constraints. Make a list of the main tasks or actions that the program should be able to perform. It means identifying input formats and noting any desired or mandatory output formats or results that the program should generate. If I have any doubts or uncertainties regarding the assignment requirements, I try to email my instructor to clear my doubts. By doing this, I can identify the problem and methods that I can use to solve the problem or create a program. By doing these things, I can obtain a comprehensive understanding of the problem and identify the key requirements. This will enable me to proceed with confidence and ensure that my solution aligns with the assignment specifications. Define: To completely understand the problem, I use the following stages to specify the exact requirements and assure a clear understanding of all inputs, processes, and outputs. Analyze the workshop PDF and break down it into smaller components or tasks to gain a better understanding of its structure. By looking at the whole workshop and the expected output in the PDF, I try to identify the main things or concepts involved in the workshop. I try to consider the relationships and interactions between different components. For example, in workshop 8 for IPC, I did my best to understand the relationship between main and functions and how can I implement them. Determine the inputs required for the solution to function correctly. The most important part is identifying the sources of these inputs, such as user input, file input, or API data. In IPC workshops input always are entered by the user. Then I check the valid range for inputs by looking at the expected output and instruction. Determine the expected format, structure, and range of valid inputs. Moreover, determining the expected outputs or results that the solution should produce is very important. Design : CPR101 Summer 2023 Week 9 Page 3 of 6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help