Skip to content

VistaProjects/Code-Challenge

Repository files navigation

Code-Challenge

24 Coding challenges

1) Create a string (1 point)

Make a string that puts all the letters of the alphabet backwards. So: zyx.....cba. created by the number code, not the letters. Do this with a loop. tip: think of ASCII.

2) Assemble string (4 points)

You get a string with a complete address: Rijksweg 44, 6533 XT Amsterdam Assignment: filter the zip code from the string The postcode location can be anywhere in the string and complies with the Dutch postcode rules tip: find the right pattern.

3) Check email address (2 points)

You get an e-mail address from an input field. Check if this is really an email address.

4) Bubble sort (4 points)

Create a program that sorts an input string. The string contains letters and/or numbers mixed up.

The output is all letters in sequence and all numbers in sequence. Use the bubble sort technique.

eg: input="test" output="est" eg: input='3618' output='1368'

5) Check phone number (2 points)

The entry is a phone number. Check whether this is a Dutch or Belgian telephone number AND whether it is a mobile number.

6) Put a two-dimensional array into a table (4 points)

The $list array contains 5 addresses, each with the last name, phone number, and email address. The command is to convert this array with an indefinite number of lines into an HTML table.

7) Fibonacci (3 points)

Find what the Fibonacci sequence is and create an algorithm that prints it on the screen. Do this for 25 elements. You have to calculate them, not take them from a table.

8) Prime numbers (3 points)

Create an application that displays all prime numbers < 100 on the screen. You have to calculate them, not take them from a table.

9) Swap contents of two variables (1 point)

a = 10, b = 20

Create a routine that swaps these 2. Use a maximum of 2 variables. So don't use a helper variable!

Result is:

$a = 10;
$b = 20:
echo $a .
echo $b;
//on the screen is now shown: 10 20

//here your piece of code and then the result is;

echo $a .
echo $b;
// the screen now shows: 20 10

10) Hanoi (6 points)

Create an application that plays the towers of hanoi. Create a simple user interface (not graphical).

11) Palindrome check (5 points)

Look up what a palindrome is.

Input: string Output: string is palindrome or not

So write any string (a word or phrase) and check whether it is a pallindrome.

12) Recursive (sort) (10 points)

Look up what recursive means! Find examples of recursive functions.

Input: row (array) of numbers Output: numbers sorted Method: recursive

So you create a function that calls itself over and over depending on the length of the array. The function checks whether the number presented from the array is greater or less than the previous number. Store the numbers in the correct order so that the array is sorted.

13) Calculate area (2 points)

Calculate the area and circumference of a circle with a given Diameter.

14) Celcius to Fahrenheit (2 points)

Input: temperature in degrees Celsius Output: temperature in °F and in K

15) Sort list(5 points)

Create a table of student names in a database. Enter student names here at random. Get the list with your code. Display the list sorted by abc.

16) String number (1 point)

A= "23" (string) B="34"(string) Output: sum of A and B with a ! so "57!"

The input must be a string, not an int. You can then typecast.

The output must again be a string, so no int.

17) Roulette (5 points)

https://youtu.be/vAqS6rvCAow

18) Name Generator (5 points)

https://youtu.be/58eJai83oT4

19) Check string input (5 points)

An input string must NOT contain SQL commands. Think of APPEND/INSERT/DELETE/DROP/..... Input: string Output: string contains SQL or not

20) Swap contents of two variables: Part 2 (1 point)

a="French" b="German" Create a routine that swaps these 2

21) Build a wall (5 points)

https://youtu.be/EMMQOtA3nXc

22) Follow the light (10 points)

https://youtu.be/eE5GEdNZ4Zo

23) Painting with Piet Mondrian (5 points)

https://youtu.be/lvTBU8H_lJY

24) Write a letter (5 points)

https://youtu.be/BPVMhMG99dY

About

24 Coding challenges

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published