Web Programming with html5, css, and JavaScript



Download 18,68 Mb.
Pdf ko'rish
bet79/98
Sana28.10.2022
Hajmi18,68 Mb.
#857632
1   ...   75   76   77   78   79   80   81   82   ...   98
Bog'liq
Web Programming with HTML5, CSS, and JavaScript

492
ChaptER 10
 
Loops, Additional Controls, Manipulating CSS with JavaScript


var product = 0;
while (count < 4) {
sum += count;
product *= count;
if (count == 4)
alert("Sum = " + sum);
alert("Product = " + product);
count++;
}
3. 
[after Section 10.5] Assume the following code is part of a working web page. What message 
will 
console.log
display?
var userTurn = true;
var userTurns = computerPoints = 0;
do {
if (userTurn) {
userTurns++;
}
else {
computerPoints++;
}
userTurn = !userTurn;
} while (userTurns < 2);
console.log("computer points: " + computerPoints);
4. 
[after Section 10.5] Suppose you have a variable named 
quantity
that holds a number. 
Provide an 
if
statement heading that checks to see whether 
quantity
holds a whole number.
5. 
[after Section 10.9] Given the following web page code that generates the factorial for a user-
entered number. Provide a standard 
for
loop that could be used to replace the 
while
loop.




Factorial Generator





min="0" max="15" step="1" required>
onclick="generateFactorial(this.form);">



Download 18,68 Mb.

Do'stlaringiz bilan baham:
1   ...   75   76   77   78   79   80   81   82   ...   98




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish