CPT Write Up
3a
- 3.a.i.: The Overall purpose of the program is to have a website where people can click on and find cars to rent that is user friendly and easy to use.
- 3.a.ii.: In the video, it shows a table that has ten different cars that are shown so anyone can rent these cars and there is a feature to where you can add a car to the database and also you can reserve a car from the home page which is my page.
- 3.a.iii.: There are a few inputs that is used in my feature which include a spot to add a new car to the database, and where you can click a button which will take you to the section to reserve the car.The output feature is when the car is added to database and when it takes you to reserve the car or see the selection of cars.
3b
- 3.b.i.:
- 3.b.ii.:
- 3.b.iii.: I am fetching from an api which loads the table full of cars.
- 3.b.iv.: The data that is represented in my program is the names and year and model of each car that we have up for rental on hour homepage which is shown in a table that is fetching from an api.
- 3.b.v.: Using the array of car from the list and that its fecthing from an api makes the program alot more user friendly and save times and runs smoother because you don’t have to manualy input each car and their features. The api does that from fetching and is shown in a table.
3c
- 3.c.i.:
- 3.c.ii.:
- 3.c.iii.: This part of the code is where the data is coming from and how the data is shown on the website and is fetching into a table that is shown on the website.
- 3.c.iv.: his piece of code is created from using the fetch feature whic is being pulled from an api using the api key code. Then you need the part where, if the data is being fetched right, then the data will be shown in a table on the website.
3d
- 3.d.i.:
- i. First call: The first call of fetch is the way the api is being shown on the webiste in a table
- ii. Second call: The second call of fetch is when the data is being pulled from the api, then if there is an error, it will display “ failed to fetch data “.
- 3.d.ii.:
- i. The first call is testing if there is no problem fetching and then fetchs data from api
- ii. The second tests if the fetch feature works, then data will be shown on website in table.
- 3.d.iii.:
- i. The result is a list of array that has all car in it.
- ii. The result is a list with table displaying all the cars.