Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 2 fuera de 6 páginas
Examen

CSCE 102 Exam 2 with complete solutions.

Document preview thumbnail
Vista previa 2 fuera de 6 páginas

Write a multi-line javascript comment that contains name and home town /Jessica Scicchitano Florence SC/ Write the code to give a variable a value that is your major's name var m='biology' Previous Play Next Rewind 10 seconds Move forward 10 seconds Unmute 0:00 / 0:15 Full screen Brainpower Read More What does the parselnt( ) do? takes a string value and makes it a number value What does padding and margin property specifies in CSS? Margin: how much space between each box model Padding: space between border and text code for when paragraph element moused over, font size becomes 32 pt p onmouseover="Size='32 pt'" Heading /p Write the CSS rule to define a solid green border with 2px of width for the H1 elements. h1{border-style:solid, border-color: green, border-width: 2px;} Using javascript, a.)prompt the user for their first name var n=prompt('Please enter your first name') b.) Prompt the user for their last name var m= prompt('please enter your last name') c.) using the results from part a and b, say hello to the user in an alert box alert('Hello" + n+ m) Write the code for a function that takes one number as an arguement and alerts the user if the number is greater than 5 or not script {function numb(n1) if (n15) alert (n1+ 'is greater than 5') else alert(n1+ 'is not greater than 5') /script write a function that takes two arguments which are id's of two paragraph elements. This function should change the text color of the first paragraph to green and the background of the second paragraph to red. script

Vista previa del contenido

CSCE 102 Exam 2 with complete
solutions




Write a multi-line javascript comment that contains name and home town -
ANSWER- /*Jessica Scicchitano Florence SC*/

Write the code to give a variable a value that is your major's name - ANSWER- var
m='biology'

What does the parselnt( ) do? - ANSWER- takes a string value and makes it a
number value

What does padding and margin property specifies in CSS? - ANSWER- Margin:
how much space between each box model
Padding: space between border and text

code for when paragraph element moused over, font size becomes 32 pt -
ANSWER- <p onmouseover="this.style.fontSize='32 pt'"> Heading </p>

Write the CSS rule to define a solid green border with 2px of width for the H1
elements. - ANSWER- h1{border-style:solid, border-color: green, border-width:
2px;}

Using javascript, a.)prompt the user for their first name - ANSWER- var
n=prompt('Please enter your first name')

b.) Prompt the user for their last name - ANSWER- var m= prompt('please enter
your last name')

c.) using the results from part a and b, say hello to the user in an alert box -
ANSWER- alert('Hello" + n+ m)

, Write the code for a function that takes one number as an arguement and alerts
the user if the number is greater than 5 or not - ANSWER- <script> {function
numb(n1) if (n1>5)
alert (n1+ 'is greater than 5')
else
alert(n1+ 'is not greater than 5')
</script>

write a function that takes two arguments which are id's of two paragraph
elements. This function should change the text color of the first paragraph to
green and the background of the second paragraph to red. - ANSWER- <script>
{function change (alb)
document.getElementById(a).style.color='green'
document.getElementById(b).style.background color='red'}

<p id="para 1" onclick="_________">text 1</p>
<p id="para 2"> text2 </p> - ANSWER- change('para1','para2')

Write code to create the first row of the following table. Start writing code with the
<table> tag and stop after writing enough code to create only the first row of the
table - ANSWER- <table>
<tr>
<th rowspan="3"> USC </th>
<th colspan="2"> CSCE102</th>
</tr>

After the following code has been executed :
var x="7" ; var y="8"; var z=x+y;
What is the vale of variable z? and what is the data type of the variable z? -
ANSWER- 78; string

After the following is executed, what would be the value of the variables m and n?
var m=9; var n=5; m=m +n ;
m= m%n; n=3; - ANSWER- m= 4, n=3

Write a function with no arguments that prompt the user to enter a number and
whether the number entered is even or odd, shows an alert box with a relative
message - ANSWER- <script>
{function number( )
var x= prompt('enter a number')
if (parseln +(x)%2=0)

Información del documento

Subido en
10 de septiembre de 2024
Número de páginas
6
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$11.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
BRAINSCAPE1
4.4
(20)
Vendido
141
Seguidores
15
Artículos
11136
Última venta
3 semanas hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes