Solved

how old are you

Posted on 2011-02-24
6
370 Views
Last Modified: 2012-05-11
     Hallo,
      
      
      
      the code should give how old someone is but it doesent work i have done everything i know
      
      Thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<title>Ahmadi Mohsen oefening 3</title>
	</head>
	<body>
		
		<script type="text/javascript">
		name = prompt("your last name");
		
		document.write( "Welkom " + name );
        </script>
		
		<script type="text/javascript">
		fname = prompt("your first name");
		yeardate = parseInt (prompt("geef uw geboortedatum"));
		year= 2010-yeardate
		alert(fname + " you are " + year + " years!"  );
		
		
		</script>

	</body>
	

</html>

Open in new window

0
Comment
Question by:kensy11
6 Comments
 
LVL 10

Accepted Solution

by:
aboo_s earned 500 total points
ID: 34969016
Well I tried your code and it told how old I am !

What seems to be the problem!?
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 34969030
i am getting the correct output here

Which browser are you trying with and what is the expected output?
0
 

Author Comment

by:kensy11
ID: 34969092
ooh im sorry i got it wrong but thanks
0
 
LVL 47

Expert Comment

by:for_yan
ID: 34969144
It actually works.
I copied it into file with .html extension (attachemnt)
if you open it in
the browser (or just save it and double-click on your PC) it asks name, last name and age and then determines
the date of birth
try.html
0
 
LVL 10

Expert Comment

by:aboo_s
ID: 34976834
This guy had me check his code and confirm it's working and then just take off with no points awarded!

This does not look too good!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ejb entity bean example 2 17
Html Table looping 4 26
Fast way to search item into Java Array (Rhino compatible) 2 31
Java 8 to Java 6 8 22
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question