Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 6 pages
Exam (elaborations)

CSCE 102 Exam 2 with complete solutions.

Document preview thumbnail
Preview 2 out of 6 pages

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

Content preview

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)

Document information

Uploaded on
September 10, 2024
Number of pages
6
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$11.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
BRAINSCAPE1
4.4
(20)
Sold
141
Followers
15
Items
11136
Last sold
3 weeks ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions