Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
2.0 kB
1
Indexable
Never
/* 
    Created on : May, 2019 
    Author     : Liisa Auer, Oulu University of Applied Sciences
    Licence    : CC-BY-4.0
*/

/*
 * Student name :Nicolas    
 * Started date :2.10.23
 * Ended   date :
 * 
 */

//Clear outputs
    document.getElementById('name1').innerHTML=''
    document.getElementById('name2').innerHTML=''   

/**
     * Print error or success message
     * 
     * @param {string} place   place to print the message
     * @param {string} message the message
     */
    function print (place,message){
        place.innerHTML += message
    }          
            


function l01() {
    let placeFirstName = document.getElementById('first_name')
    let placeLastName = document.getElementById('last_name')

    let firstname = document.getElementById('name1').value
    let lastname = document.getElementById('name2').value
    for (i=0;i<5;i++){
        print(placeFirstName,firstname + '<br>')
        print(placeLastName,lastname + '<br>')
    }
}

function l02() {
    let place = document.getElementById('five')
    

    for (i=5;i<50;i=i+5){
        print(place, i + " ")
    }    

}

function l03() {
    let place1 = document.getElementById('stars1')
    let place2 = document.getElementById('stars2')
    
    let number = document.getElementById('amount').value

    //loop x time then print one <br> per loop
    //for each loop add the 
    for(i=1;i<=number;i++){
        for(j=0;j<i;j++){
            place2.innerHTML += "*";    
        }
        place2.innerHTML += '<br>';
    }
    while (i=1;i<=number;i++){
        while 
    }

}

function l04() {

}

function l05() {

}

// copy and paste here the random number generator function 
// and use it in the following functions



function l06() {   

}

function l07() {

}

function l08() {

}

function l09() {
    const space = ";&nbsp;&nbsp;";

}