This repository has been archived on 2024-09-11. You can view files and clone it, but cannot push or open issues or pull requests.
Files
IT2/html/test_15.11.19/javascript/task2.js
2020-01-29 12:56:06 +01:00

14 lines
671 B
JavaScript
Executable File

/*Input from user and convert to lower case*/
const firstName = prompt("Hva er fornavnet ditt?").toLowerCase();
const surname = prompt("Hva er etternavnet ditt?").toLowerCase();
const domain = prompt("Skriv inn et domenenavn", "eksempel.no").toLowerCase();
/*Combine the input and print it out*/
const email = firstName + "." + surname + "@" + domain;
console.log("Email: " + email);
/*Combine and add a random number between 1 and 100 with a little bit lower probability for 1 and 100*/
const mailNum = parseInt((Math.random() *100) +1);
const altEmail = firstName + "." + surname + mailNum + "@" + domain;
console.log ("Alternativ Email: " + altEmail);