Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- document.write("<br>Zadanie 1<br><br>");
- const prod1={
- name: "Seler",
- price: 2.39,
- weight: 0.5,
- }
- const prod2={
- name: "Pietruszka",
- price: 4.99,
- weight: 0.17
- }
- document.write("Produkt numer jeden to: "+prod1.name+"<br>");
- document.write("Produkt numer dwa to: "+prod2.name+"<br>");
- document.write("Produkty kosztują razem: "+(prod1.price*100+prod2.price*100)/100+"<br>");
- document.write("Produkty ważą razem: "+(prod1.weight*100+prod2.weight*100)/100+"<br>");
- document.write("<br>Zadanie 2<br><br>");
- const currentUser={
- name:"Jakub",
- surname:"Kowalski",
- email:"jakubkowalski@pocztapolska.pl",
- www:"kowalskigotuje.pl",
- userType:"użytkownik standardowy",
- show(){
- return "Imie: "+this.name + "<br>" + "Nazwisko: " +this.surname + "<br>" + "Email: " +this.email + "<br>" + "Strona: " +this.www + "<br>" + "Rodzaj użytkownika: " +this.userType+ "<br>";
- }
- }
- document.write(currentUser.show());
- document.write("<br>Zadanie 3<br><br>");
- const book={
- title:"Matrioszka Rosja",
- author:"Maciej Jastrzębski",
- pageCount: 285,
- publisher:"editio",
- showDetails(){
- for(const key in book)
- {document.write((key)+": "+(book[key])+"<br>");}
- }
- }
- book.showDetails();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement