Pre bootcamp coding challenges

Hard Prerequisites
  • TOPICS: Honor Code

  • Complete these tasks in the correct language. If you are here to learn JavaScript, do them in JavaScript. If you have been told to use Python then use Python.

    Use Git and Github to save your code to the cloud (like a boss)

    Please remember that you need to focus on UNDERSTANDING!

    Some of these task are kinda easy, but they were all chosen for good reasons. Try think about the lessons each task is trying to teach you. Think about what might confuse other people.

    Some of these are difficult. If you can’t complete all of them, it’s ok. Just do your best and seek out help when you need it

    Task 1

    Convert this pseudocode into actual code. Make it run. Make sure you understand the results. This is a fundamental lesson:

    x = 0
    y = 1
    Print the value of x
    Print the value of y
    x = x + 3
    y = y + x
    Print the value of x
    Print the value of y
    

    Check your understanding:

    Lots of people think this is easy then get it wrong later. Make sure you check yourself

    • do you know what pseudocode means? Did you look it up?
    • do you understand why x and y have the values they have at each point in the program?

    Task 2

    Convert this pseudocode into actual code. Make it run. Make sure you understand the results. This is a fundamental lesson. If you don’t understand the results then spend some time Googling BODMAS.

    x = 1 + 1 * 2
    y = (1 + 1) * 2
    z = 1 + ( 1 * 2 )
    a =  1 + 1 * 2 / 2
    b =  (1 + 1 * 2 ) /  2
    

    Check your understanding:

    • do you know what pseudocode means? Did you look it up?
    • do you understand why the variables have the values they have at each point in the program?
    • do you understand BODMAS?

    Task 3

    Write a function that takes 2 numbers as input. If either of the numbers is 65, OR if the sum of the numbers is 65 then return true. Otherwise return false.

    Task 4

    Write a function that takes 2 numbers as input. If either of the numbers is 3 AND the sum of the numbers contains a 3 then return true. Otherwise return false

    Task 5

    Write a function that takes in three numbers. These numbers represent the lengths of the sides of a triangle. The function should return the area of a triangle.

    This might help: https://www.wikihow.com/Calculate-the-Area-of-a-Triangle

    Task 6

    White a function that takes in three numbers and returns the maximum number. Do this without using any builtin methods. Write your own logic from scratch.

    Bonus: How can you change the code so it can take in any number of numbers?

    Task 7

    Write a function that takes in a number representing the temperature in Celsius and returns the temperature in Fahrenheit. Write another function that does the opposite (Fereignheit to Celsius)

    Task 8

    Make a function to convert any number into hours and minutes. (For example, 71 will become “1 hour, 11 minutes”; 133 will become “2 hours, 13 minutes”.)

    Task 9

    If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

    Find the sum of all the multiples of 3 or 5 below 1000.

    Task 10

    Write a function that takes in a string and then prints out all the vowels in the string. Make sure it can deal with capital letters and small letters.

    Task 11

    Make a function that takes two strings as input, and outputs the common characters/letters that they share. (For example, Input: ‘house’, ‘computers’ . Output: ‘Common letters: o, u, e, s’)

    Task 12

    This task isn’t compulsory but we’ll be impressed if you do it.

    Can you make a user interface for each of the previous tasks? You’ll need HTML and CSS to do it.


    RAW CONTENT URL