I need to finish this assignment:
-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:
<title>Lab Assignment #4 CIS 111</title>
name = window.prompt( "Please Enter Your Name:" );
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>" );
<p>Click Refresh (or Reload) to run this script again.</p>
Any Help will be much appreciated!! Thanks!!
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
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)