<file_sep>var employees = JSON.parse(teamMembers);


for(var i=0; i<employees.length; i++)
{
    document.getElementById('employees').innerHTML += `
<h2>${employees[i].name}</h2>
<h3>${employees[i].email}</h3>
<img alt ="sor<NAME>" src="${employees[i].image}"</h3>
<br><br>
`
}
<file_sep><!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/style.css">
</head>

<body>

    <header>
        <img id="logo" src="img/logo.png">
        <img src="img/banner.png">
    </header>

    <nav>
        <ul>
            <li>Home</li>
            <li><a href="team.html">Team</a></li>
        </ul>
    </nav>

    <main>
        <h1 id="first">Car insurance</h1>

        <div id="second">
            <h2>Great coverage begins with a custom quote</h2>
            <form id="form">
                <div>
                    <label>Your name:</label><br>
                    <input type="text" id="name">
                </div>
                <div>
                    <label>Age:</label><br>
                    <input type="text" id="age">
                </div>
                <div>
                    <label>Country:</label><br>
                    <select id="select">
                        <option value="Austria">Austria</option>
                        <option value="Hungary">Hungary</option>
                        <option value="Greece">Greece</option>
                    </select>
                </div>
                <div>
                    <label>Horsepower of your car:</label><br>
                    <input type="text" id="name">
                </div>
            </form>
            <br>
            <button id="btn">Calculate</button>
            <p id="result"></p>

        </div>

        <div id="bottom">
            <h3>Un-complicating car coverage</h3>
            <p>Understanding your coverage options SHouldn't be so hard.</p>
            <p>We'll guide you through available coverage types,</p>
            <p>starting with who and what is covered</p>
        </div>

    </main>
    <section>
        <div id="flexbox">
            <div class="square">
                <h4>What comes standard</h4>
                <br>
                <p>✔The coverage you need</p>
                <p>✔ Bodily Injury Liability</p>
                <p>✔ Property Damage</p>
                <br><br>
                <h5>Benefits</h5>
                <p>12-month rate guarantee | 24/7 customer service | Lifetime Repair Guarantee</p>
            </div>
            <div class="square">
                <h4>Add-on protection & coverage</h4>
                <br>
                <p>✔ Better Car Replacement</p>
                <p>✔ Towin & Labor</p>
                <p>✔ Rental Car Coverage</p>
                <br><br>
                <h5>Earned Benefits</h5>
                <p>Accident Forgiveness | New Car Replacement &trade;</p>
            </div>

        </div>
    </section>

    <footer>
        <nav id=navFooter>
            <ul>
                <li>Home</li>
                <li>Team</li>
            </ul>
        </nav>
        <img src="img/logo-inv.png">
        <h2><NAME> - CodeFactory 2020</h2>
    </footer>
    <script src="js/code review.js"></script>
</body>

</html><file_sep># CF-CR3-Alejandro

We were required to create a website that could calculate price insurances.
The layout is based on the picture provided by CodeFactory, using HTML and CSS.
The functions use the formula provided by CodeFactory, and are written in javascript.
<file_sep>var input = document.getElementsByTagName('input');

var result = document.getElementById('result');
var select = document.getElementById('select');

function calculateInsurance() {
    var horsePower = input[2].value;
    var age = input[1].value;
    var name = input[0].value;
    if (select.value == "Austria") {
        result.innerHTML = name + ", your insurance costs " + Math.round((horsePower * 100 / age + 50)) + " eur";
    }
    else if (select.value == "Hungary") {
        result.innerHTML = name + ", your insurance costs " + Math.round((horsePower * 120 / age + 50)) + " eur";
    }
    else {
        result.innerHTML = name + ", your insurance costs " + Math.round((horsePower * 150 / (age + 3) + 50)) + " eur";
    }
}

document.getElementById('btn').addEventListener('click', calculateInsurance, false);