Day 1: Create an HTML page on codepen.io using the tags learnt
Day 2: Create an HTML page on codepen.io using 5 block and inline elements each
- Signup for a github.com account
- Fork https://github.com/attainu-falcon/attainu-falcon
- Create a file named
why_i_want_to_be_a_programmer.txt
inside theassignments
folder. - Write a short note in the file why you want to be a programmer? :)
- Add upstream url to your remote.
- Create a folder called
HTML
inside theassignments
folder. - Create 2 empty files named
first.html
andsecond.html
inside the aboveHTML
folder. - Copy the code from your 2 codepen assignments into the respective files.
- Name the new repo 'HelloWorld'.
- Create a folder called
assignments
inside this repo. - Create a blank file named
helloworld.txt
inside theassignments
folder. - Go to your forked
attainu-falcon
repo and add remote url of this new repo. - Pull changes from the remote to your forked repo.
- Pull changes into your repo.
- Create a folder named
AboutMe
inside theassignments
folder. - Inside the above folder, create a page about you with
html
andcss
having:- A heading with your name.
- A short paragraph about you.
- A list of your favourite movies.
- Pull changes into your repo.
- Create a folder named
WebMail
inside theassignments
folder. - Inside the above folder, create a web-mail page which has three sections:
- The left one is for navigation and contains links for Inbox, Sent, Drafts & Trash. You can use an un-ordered list to do that.
- The right box is a table of emails with coloumns for From, Subject & Date.
- The bottom one is for placing ads.
- You can use sizes, colors, font etc according to your choice.
- Pull changes into your repo.
- Create a folder named
MyShop
inside theassignments
folder. - Inside the above folder, create a page which has these sections:
- The header at the top is fixed and does not hide on scroll.
- The next one is for navigation and contains links for categories and a search box. You can use an un-ordered list to do that. This is also fixed and does not hide on scroll.
- On the left we have a sidebar for filters. It has checkboxes
- On the right is the product catalogue including price and other details.
- You have a select dropdown for the 'Sort By' option.
- This is an assignment where you are required to build to given specifications.
- Put your codes inside a
MultiplyJS
folder underassignments
. n
should be entered in a input of typenumber
.- There should be a button with text 'Print Multiplication Table', when clicked should show the output in the following format (assuming n is 5):
1 * 5 = 5
2 * 5 = 10
.
.
.
10 * 5 = 50
- Put your codes inside a
CalculatorJS
folder underassignments
. - Use inputs of type
number
. - Use functions as and when necessary.
Day 2: Create a Javascript program that produces a table of numbers from 1 to 10 and squares of them:
- Put your codes inside a
ManipulationJS
folder underassignments
. - Use DOM manipulation to create all the HTML elements. That is the HTML should only contain a
body
tag.
- Put your codes inside a
LoginJS
folder underassignments
. - Validate the inputs:
- Username or password cannot be blank.
- Username cannot be less than 5 characters.
- Password cannot be less than 8 characters.
- Username can only contain alphabets, digits and
_
. - Username cannot start with a digit.
- Username should be case-insensitive.
- Username and password can be hardcoded in the JavaScript file.
- Put your codes inside a
LoginBS
folder underassignments
. - The template can be found at https://getbootstrap.com/docs/4.3/examples/sign-in/.
- Look at the page source and try to get the UI as close as possible.
Home page About Us page Contact Us page
- Put your codes inside a
CompanyBS
folder underassignments
. - Use documentation at https://getbootstrap.com/ for help.
- Do not use any custom css styles.
- You are free to replace text content in the pictures.
- The application should have four routes that perform addition, subtraction, multiplication and division.
- The add route should take two url parameters and send back their sum.
- The sub route should take two url parameters and send back their difference.
- The mul route should take two url parameters and send back their product.
- The div route should take two url parameters and send back their division result.
- Put your files inside a
Express_Calculator
folder underassignments
.
- Create four routes in Express for add, sub, mul and div.
- Each route should take two POST data parameters -
num1
andnum2
in JSON format and do the arithmetic operation on them. - For instance, the response for the add route should look like the following:
{
"num1": 20,
"num2": 50,
"result": 70
}
- No need for UI. Everything can be tested using Postman.
- Put your files inside an
Express_RESTful
folder underassignments
.
Day 3: Create a login portal in Express with the following components (as shown in yesterday's lecture):
- A students.json which stores data for students including their
username
andpassword
. - A login form as created in a previous assignment (LoginJS, LoginBS).
- An authentication route which uses a students.json to verify login.
- A redirection route only visible after successful login. You can use the webmail assignment as this protected route.
- A logout route to destroy the session.
- Put your files inside an
Express_Session
folder underassignments
.
- Store a set of name and tweet data in a variable in Express.
var tweets = [ { name: "digitizer", tweet: "This is a cool piece of information." }, { name: "M0SH", tweet: "@digitizer I agree." } ]
- A default route which displays this data in the UI.
- This page displays a form - a name input, a tweet input and a submit button at the end.
- The same route should be the form action handler for the POST request on the submit button. You can post data directly as urlencoded or use JavaScript to post it as JSON.
- Update the data variable in Express on a successful POST request.
- Also, update the UI to reflect the new tweets that have been posted.
- Put your files inside an
Express_Twitter
folder underassignments
.
- Make a copy of the above assignment and modify the code to use data from a
tweets
collection in a database stored on a MongoDB server. - The new tweet from the form should update this database collection.
- The UI should reflect the updates in the database collection.
- Put your files inside an
Express_MongoDB
folder underassignments
.
- Create a database for AttainU with collections of students and instructors (name, email, phone, age, etc.).
- Create CRUD routes to add, get, modify and delete student documents.
- Create a view at
/instructors
to show all instructor information as bootstrap cards. - Create a separate view at
/students
to show all student information as bootstrap cards. - On the student card have an
Edit
option which turns information to input boxes and an option toSave
. - Create a view at
/students/add
with a form to add a new student to the collection. - Also have a
Delete
option. - Put your files inside an
Express_AttainU
folder underassignments
.
- Use semantic HTML elements only.
- Use CSS flexbox layout to achieve the layout shown in the image.
- Put your files under
assignments
>week12
>day02
. - Move all other assignments under
assignments
>shallow-dive
.
Solution session: day-0
Due day: day-0
- Clicking on each button should update the counter about it.
- For
Global Counter
use a global variable to keep track of the clicks. - For
Object Counter
, use an object to keep track of the clicks. - And finally for
Closure Counter
, use a closure to keep track of the clicks. - You can use either Vanialla JS + DOM methods or jQuery for event handlers.
- Put your files under
assignments
>week12
>weekly-test
.
Due day: day-3
- The assignment is to create a Javascript class called
MyArray
making use of a constructor to initialize a property namedarray
. - The constructor should take arguments passed to it as the initial elements of array, like
MyArray(5, 2, 6, 4, 3, 1)
. - The object should have three methods:
print()
- Prints the content of the array to console.search(searchValue)
- Searches the passed element in the array and returns the index if found. If not found, returns-1
.sort()
- Sorts the array in descending order. No need to use any sorting algorithm. Use JS array methods to implement the same.
Note: JS arrays sort alphabetically as strings by default. Reference
Due day: day-0
Consider this array -
var numbers = [4, 28, 43, 34, 37, 41, 26, 49, 33, 19, 36, 25, 47, 20, 1, 45, 6, 5, 27, 48];
Write a program that generates an array of squares of only even numbers from the above array.
The output should be -
[ 16, 784, 1156, 676, 1296, 400, 36, 2304 ]
And you have to write the logic in both imperative style and functional style.
Due day: day-1
- Generate 5 two-digit random numbers between 1 and 100.
- For each of the numbers generated call the api,
https://pokeapi.co/api/v2/pokemon/xx
(xx
being the two-digit number). - The result of this api call, will give you the
height
property which is an integer. - Add
height
for all the 5 pokemons. If this sum is an even number, resolve the promise alerting this sum. - If sum is an odd number, reject the promise alerting this sum.
- Put your files under
assignments
>week13
>weekly-test
.
Hint: Use Math.random()
to generate random numbers.
Due day: day-3
- Use the timer example at https://reactjs.org/ and modify it to tick at every 100 millisecond. 0.0, 0.1, 0.2 -> ...
- Add this .jsx code to an npm project. Reference
- Use
npx
commands to compile .jsx to js. - Use the compiled file as a script in your html file.
- Give the html an
h1
of 'React 100ms Counter'. - Put your files under
assignments
>week14
>day01
.
Hint: Use number.toFixed()
to display 45
as 45.0
. Reference
Due day: day-0
- Create a
LoginForm
component that renders two inputs and a button. - Break down into as many components as you can.
- Use
npx
commands to compile .jsx to js. - Use the compiled file as a script in your html file.
- Put your files under
assignments
>week14
>day02
.
Due day: day-0
We have created a simple calculator using JavaScript before.
Now let's create the same one using React. All the arithmetic operations should be implemented using functions.
Due day: day-0
Create a React app which loads a question from the quiz.json file. You can store the json as in a variable in your component.
On clicking the submit button, the app should show the next question and keep a track of the number of questions that have been answered correctly.
Also present is a timer component which ticks every second for 60 seconds. Once the timer shuts down or if all the 10 questions are answered, the app should display the score for the user.
Due day: day-3
Create the following pages in React:
Home About Us page Contact Us page
- For this assignment, the pages will be written as React components.
- You are free to divide each page into as many components you wish.
- You need to use the
react-dom-router
package for routing/linking the pages. - Put your files under
assignments
>week15
>day02
.
Due day: day-0
Create a calendar component in React which,
- Consists of an input element.
- Creates a table of dates for the month of August 2019 on focusing on this element.
- On clicking any date in the calendar the input box should update the value to the selected date in the format
dd.mm.yy
. - Put your files under
assignments
>week15
>day04
.
Due day: day-1
Create a webmail app in React which,
- Create the webmail app with navigation component on the left (Inbox, Sent, Drafts, Trash).
- On clicking each of these render the component with list of mails in that category.
- The above component gets the category as its prop and filters mails accordingly.
- Use mail.json to fetch relevant data.
- Put your files under
assignments
>week15
>weekly-test
.
Due day: day-3
Create a Redux store and reducer with the following initial state :
currentScore: 0
The reducer should accept the following actions -
UPDATE_BONUS
LEVEL_COMPLETED
LIFE_LOST
UPDATE_BONUS
should increment the currentScore
by 100
LEVEL_COMPLETED
should increment the currentScore
by 500
LIFE_LOST
should decrement the currentScore
by 250
Due day: day-1
Modify the Twitter app in React to use Redux.
Have the same 3 components: TweetContainer
, Tweet
, TweetForm
Posting a new tweet should dispatch an action to update the global store.
Lets create a React + Redux app similar to the attached picture.
As you can see, an user can enter a number and click on three buttons which will generate square or cube or square root depending on the button pressed.
Here are the requirements
- Use Redux store to manage your application state.
- Use ES6 modules to split your app into multiple components and store.
Have at least four separate components - Input
, SquareButton
, CubeButton
, SquareRootButton
in different files and import all of them in App.js
and then finally render them inside index.js
.
Put your files like discussed for better review.
- action creators -> inside
actions
folder - reducers -> inside
reducers
folder - store -> in a
store.js
file
Hint: The first step should be to divide the task into appropriate number of reducers and actions. This app can be done with single reducer containing 3 actions.
- Adding to the same assignment above, create 3 more components -
RedButton
,GreenButton
,BlueButton
. - Display these buttons on the same page as previous, below the existing buttons.
- On clicking on any of these, dispatch actions to a
colorReducer
to update the color code in the store. - Use this state variable to set the
input -> backgroundColor
in the Input component. Use inline styling.
- Create an app in React + Redux with 3 components - App, UserList and RepoList.
- Fetch a list of users from
https://api.github.com/users
and display in UserList like shown. - On clicking the
Show repos
button on any user card, fetch the list of repos for the user and display inRepoList
. eg,https://api.github.com/users/defunkt/repos
- There will be two reducers each for fetching
users
andrepos
.
Create a webmail app in React + Redux which,
- Displays a navigation component on the left (Inbox, Sent, Drafts, Trash).
- On clicking any of these render the component with list of mails in that category.
- This component dispatches the corresponding action + a payload of filtered mails to the reducer.
- Use mail.json to fetch relevant data.
- Put your files under
assignments
>week19
>day01
.
Due day: day-1
Modify the webmail app in React + Redux to,
- Show a checkbox beside the mail.
- On clicking on it, mark that mail as read.
- Unselecting the checkbox should mark it as unread again.
- This component dispatches the corresponding action to the store to update the corresponding mail object to add a new key
read: true
. - On the initial load, the key would not exist, which should be taken as an unread mail.
Due day: day-1
Implement merge sort for an array of numbers.
Due day: day-0
Example:
Input: 1->2->3->4->5->NULL
Output: 5->4->3->2->1->NULL
Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both?
Given a linked list of N nodes. The task is to check if the the linked list has a loop. Linked list can contain self loop.
Given a list of words with lower cases. Implement a function to find all Words that have the same unique character set .
Example:
Input: words = ["may", "student", "students", "dog",
"studentssess", "god", "cat", "act",
"tab", "bat", "flow", "wolf", "lambs",
"amy", "yam", "balms", "looped",
"poodle"];
Output :
looped, poodle,
lambs, balms,
flow, wolf,
tab, bat,
may, amy, yam,
student, students, studentssess,
dog, god,
cat, act,
All words with same set of characters are printed together in a line.
Given an array of integers, find two numbers such that they add up to a specific 'target' number.
The function twoSum
should return indices of the two numbers such that they add up to the 'target', where index1
< index2
.
If multiple solutions exist, output the one where index2
is minimum. If there are multiple solutions with the minimum index2
, choose the one with minimum index1
out of them.
Input: [2, 7, 11, 15], target=9
Output: index1 = 0, index2 = 1
Given an array, check if the given array represents a binary max-heap.
Examples:
Input: let array = [90, 15, 10, 7, 12, 2]
Output: true
The given array represents below tree
90
/ \
15 10
/ \ /
7 12 2
The tree follows the max-heap property as every
node is greater than all of its descendants.
Input: let array = [9, 15, 10, 7, 12, 11]
Output: false
The given array represents below tree
9
/ \
15 10
/ \ /
7 12 11
The tree doesn't follow max-heap property. 9 is
smaller than 15 and 10, and 10 is smaller than 11.
- Implement Heap Sort function for a numerical array.
- Try printing out the heap at each outer loop completion.