Skip to content

Instantly share code, notes, and snippets.

View alwaisy's full-sized avatar

Awais alwaisy alwaisy

View GitHub Profile
/**
Objective
Today, we're learning about Interfaces. Check out the Tutorial tab for learning materials and an instructional video!
Task
The AdvancedArithmetic interface and the method declaration for the abstract divisorSum(n) method are provided for you in the editor below.
Complete the implementation of Calculator class, which implements the AdvancedArithmetic interface. The implementation for the divisorSum(n) method must return the sum of all divisors of .
Example
/**
Welcome to Day 18! Today we're learning about Stacks and Queues. Check out the Tutorial tab for learning materials and an instructional video!
A palindrome is a word, phrase, number, or other sequence of characters which reads the same backwards and forwards. Can you determine if a given string, , is a palindrome?
To solve this challenge, we must first take each character in , enqueue it in a queue, and also push that same character onto a stack. Once that's done, we must dequeue the first character from the queue and pop the top character off the stack, then compare the two characters to see if they are the same; as long as the characters match, we continue dequeueing, popping, and comparing each character until our containers are empty (a non-match means isn't a palindrome).
Write the following declarations and implementations:
Two instance variables: one for your , and one for your .
/**
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
/**
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
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'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:
@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

@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 / 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.

// 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