Skip to content

Instantly share code, notes, and snippets.

View alwaisy's full-sized avatar

Awais alwaisy alwaisy

View GitHub Profile
// problem
Objective
Today, we're learning about Key-Value pair mappings using a Map or Dictionary data structure. Check out the Tutorial tab for learning materials and an instructional video!
Task
Given names and phone numbers, assemble a phone book that maps friends' names to their respective phone numbers. You will then be given an unknown number of names to query your phone book for. For each queried, print the associated entry from your phone book on a new line in the form name=phoneNumber; if an entry for is not found, print Not found instead.
Note: Your phone book should be a Dictionary/Map/HashMap data structure.
Input Format
// problem
Objective
Today, we are learning about an algorithmic concept called recursion. Check out the Tutorial tab for learning materials and an instructional video.
Recursive Method for Calculating Factorial
Function Description
Complete the factorial function in the editor below. Be sure to use recursion.
factorial has the following paramter:
// problem
/**
Objective
Today, we're working with binary numbers. Check out the Tutorial tab for learning materials and an instructional video!
Task
Given a base- integer, , convert it to binary (base-). Then find and print the base- integer denoting the maximum number of consecutive 's in 's binary representation. When working with different bases, it is common to show the base as a subscript.
Example
@alwaisy
alwaisy / bootstrap-4-modal-fullscreen.markdown
Created September 15, 2022 18:20
Bootstrap 4 Modal Fullscreen

Bootstrap 4 Modal Fullscreen

Responsive Fullscreen Modal Dialogs for Bootstrap 4.

Fullscreen Modals can be enabled only on certain breakpoints. In this way the modal will display "normal" for desktops and fullscreen for mobile devices, giving it the feeling of a native app.

Adapted from: twbs/bootstrap#28683.

A Pen by Andrei Victor Bulearca on CodePen.

@alwaisy
alwaisy / bootstrap-4-modal-fullscreen.markdown
Created September 15, 2022 18:25
Bootstrap 4 Modal Fullscreen

Bootstrap 4 Modal Fullscreen

Responsive Fullscreen Modal Dialogs for Bootstrap 4.

Fullscreen Modals can be enabled only on certain breakpoints. In this way the modal will display "normal" for desktops and fullscreen for mobile devices, giving it the feeling of a native app.

Adapted from: twbs/bootstrap#28683.

A Pen by Andrei Victor Bulearca on CodePen.

@alwaisy
alwaisy / projects-have-made.md
Last active March 4, 2023 01:39
Projects I have made

Lyricofy - A music app with shazam api - github

TukaTuk - A video uploading app like tiktok - github

Dollarstore - eCommerce store with commercejs integration - gitlab

The illnesses - Design to code with tailwind - github

Sigmawebstore - eCommerce store for client - bitbucket

/**
Objective
Today, we're delving into Inheritance. Check out the attached tutorial for learning materials and an instructional video.
Task
You are given two classes, Person and Student, where Person is the base class and Student is the derived class. Completed code for Person and a declaration for Student are provided for you in the editor. Observe that Student inherits all the properties of Person.
Complete the Student class by writing the following:
/**
Objective
Today, we will extend what we learned yesterday about Inheritance to Abstract Classes. Because this is a very specific object oriented concept, submissions are limited to the few languages that use this construct. Check out the Tutorial tab for learning materials and an instructional video.
Task
Given a Book class and a Solution class, write a MyBook class that does the following:
Inherits from Book
Has a parameterized constructor taking these parameters:
/**
Objective
Today we will work with a Linked List. Check out the Tutorial tab for learning materials and an instructional video.
A Node class is provided for you in the editor. A Node object has an integer data field, , and a Node instance pointer, , pointing to another node (i.e.: the next node in the list).
A Node insert function is also declared in your editor. It has two parameters: a pointer, , pointing to the first node of a linked list, and an integer, , that must be added to the end of the list as a new Node object.
Task
Complete the insert function in your editor so that it creates a new Node (pass as the Node constructor argument) and inserts it at the tail of the linked list referenced by the parameter. Once the new node is added, return the reference to the node.
/**
Objective
Yesterday's challenge taught you to manage exceptional situations by using try and catch blocks. In today's challenge, you will practice throwing and propagating an exception. Check out the Tutorial tab for learning materials and an instructional video.
Task
Write a Calculator class with a single method: int power(int,int). The power method takes two integers, and , as parameters and returns the integer result of . If either or is negative, then the method must throw an exception with the message: n and p should be non-negative.
Note: Do not use an access modifier (e.g.: public) in the declaration for your Calculator class.
Input Format