From 504d766482964f5ab931a85253b6a133ccd878ce Mon Sep 17 00:00:00 2001 From: Hani107 Date: Sun, 16 Nov 2025 18:21:05 -0500 Subject: [PATCH] finished --- challenges.js | 38 +++++++++++++++++++++++++++++++++++++- index.html | 1 + 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/challenges.js b/challenges.js index 9813c94..3d247bc 100644 --- a/challenges.js +++ b/challenges.js @@ -18,10 +18,29 @@ Output: "The late fee is $2.50." // ✍️ ✍️ ✍️ ✍️ Write the function here ✍️ ✍️ ✍️ ✍️ +function calculateLateFee() { + const useroverduedays = prompt ("the number of overduedays") + const overduedays = 0.25 + const total = overduedays * useroverduedays + console.log (`The late fee is $${total}`) + +} + +calculateLateFee() // Extra Task: // - Convert the function into a function expression. +const calculateLateFeetol = function (){ + const useroverduedays = prompt ("the number of overduedays") + const overduedays = 0.25 + const total = overduedays * useroverduedays + + console.log (`The late fee is $${total}`) + + +} +calculateLateFee() @@ -45,7 +64,7 @@ Output: "Red: You are passionate and bold." // ✍️ ✍️ ✍️ ✍️ Write the function here ✍️ ✍️ ✍️ ✍️ - +console.log ("hani") // Extra Task: // - Rewrite the function using an arrow function. @@ -68,12 +87,19 @@ Output: "Case #12345: John Doe's case is now logged." // ✍️ ✍️ ✍️ ✍️ Write the function here ✍️ ✍️ ✍️ ✍️ +function logCase (clientName,caseNumber) { + console.log ('case # {clientName}${caseNumber} case is now logged in ') +} +logCase() // Extra Task: // - Rewrite the function as an arrow function. +const arrow = () => { +} +logCase() /* Task 4 : Attendance Tracker 🚀🚀🚀🚀 @@ -94,11 +120,21 @@ Output: "Amina is present." // ✍️ ✍️ ✍️ ✍️ Write the function here ✍️ ✍️ ✍️ ✍️ +function markAttendance (studentName, isPresent) { + + if (isPresent) { + console.log (studentName ,"is present" ) + } else { + console.log (studentName ," is absent ") + } + } +markAttendance ("ahmed" , true) // Extra Task: // - Convert the function into a function expression. +// const markAttendance = faction() /* diff --git a/index.html b/index.html index a56d8b1..ae82092 100644 --- a/index.html +++ b/index.html @@ -6,5 +6,6 @@

Check the console log for changes

+