# Need Help with HTML/JavaScript Assigment (I'm new in HTML/JavaScript)

• 03-28-2013, 01:45 PM
gflores5725
Need Help with HTML/JavaScript Assigment (I'm new in HTML/JavaScript)
I need to finish this assignment:

Requirements:

-Use prompt dialog boxes for input.
-Get the user.s name.
-Get a 3 digit integer value from the user and convert it into an integer with the parseInt method.
-Calculate the number of hundreds in the integer.
-Calculate the number of tens in the integer.
-Calculate the number of ones in the integer.
-Output Programmed by Your Name, the user.s name, the number input and the number of hundreds, tens, and ones in the number. Use one line for each and be sure to label your output clearly.

This is what I've come up with so far, but I can't figure out the Calculate part of the code:

<html>
<title>Lab Assignment #4 CIS 111</title>
<script type = "text/javascript">

var name;
var integer;

integer = window.prompt( "Please A Three Digit Integer:" );

integer = parseInt( integer );

document.writeln( "<h1>This Was Programmed by Gerson Flores. The User's Name Is, " + name +
", The Three Digit Integer Entered By User Is: " + integer + "</h1>" );

</script>
<body>
<p>Click Refresh (or Reload) to run this script again.</p>
</body>
</html>

Any Help will be much appreciated!! Thanks!!
• 03-28-2013, 05:04 PM
xelawho
I guess if you are using prompt and document.writeIn you won't have covered the modulus operator yet, so instead, just think about how you would do this on pen and paper... divide the first number by 100, see how many complete 100's there are, get the remainder, divide it by ten, see how many complete tens there are, etc

## X vBulletin 4.2.2 Debug Information

• Page Generation 0.13374 seconds
• Memory Usage 2,345KB
• Queries Executed 11 (?)
Template Usage (19):
• (1)footer
• (1)gobutton
• (1)navbar_moderation
• (1)navbar_noticebit
• (2)option
• (1)spacer_close
• (1)spacer_open

Phrase Groups Available (3):
• global
• postbit
Included Files (19):
• ./global.php
• ./includes/class_bootstrap.php
• ./includes/init.php
• ./includes/class_core.php
• ./includes/config.php
• ./includes/functions.php
• ./includes/class_friendly_url.php
• ./includes/class_hook.php
• ./includes/class_bootstrap_framework.php
• ./vb/vb.php
• ./vb/phrase.php
• ./includes/functions_calendar.php
• ./includes/class_bbcode_alt.php
• ./includes/class_bbcode.php
• ./includes/functions_bigthree.php
• ./includes/functions_notice.php

Hooks Called (41):
• init_startup
• init_startup_session_setup_start
• database_pre_fetch_array
• database_post_fetch_array
• init_startup_session_setup_complete
• global_bootstrap_init_start
• global_bootstrap_init_complete
• cache_permissions
• fetch_foruminfo
• global_state_check
• global_bootstrap_complete
• global_start
• style_fetch
• global_setup_complete
• bbcode_fetch_tags
• bbcode_create
• bbcode_parse_start
• bbcode_parse_complete_precache
• bbcode_parse_complete
• cache_templates
• cache_templates_process
• template_register_var
• template_render_output
• fetch_template_start
• fetch_template_complete
• parse_templates