954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

console program ?

Does anyone know a console program runnable from DOS that prompts user to input length/width of rectangle then prints rectangles area/perimeter ?

clulss
Newbie Poster
2 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
 

In HTML? No. JavaScript is a web-client language, so has no access to the DOS console. I think you're in the wrong forum... and frankly, I have no idea what forum your request would go in.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 
In HTML? No. JavaScript is a web-client language, so has no access to the DOS console. I think you're in the wrong forum... and frankly, I have no idea what forum your request would go in.


I meant to say executable from the ms-dos prompt. If that still is impossible then a HTML solution would be great.

clulss
Newbie Poster
2 posts since Sep 2006
Reputation Points: 10
Solved Threads: 0
 

It isn't impossible. It's just impossible using the web. HTML cannot execute a DOS program. HTML cannot execute anything; it's interpreted by a browser.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

Yes, this question belongs in Software development -- IF you are trying to develop the code yourself. If not, just use a calculator.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,509 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

console program written in 20 seconds. obviously you need to install ruby (unless you using linux or mac on which its already installed)

#!/usr/bin/ruby

puts "Width :"
w = gets.chomp.to_i

puts "Length : "
l = gets.chomp.to_i

p = (w*2)+(l*2)
a = w*l

puts "Perimeter = #{p.to_s}"
puts "Area = #{a.to_s}"
pty
Posting Pro
530 posts since Oct 2005
Reputation Points: 64
Solved Threads: 39
 

The point isn't whether a console application can be written. Please read the original question: how to start a DOS prompt and run an executable. Obviously this is impossible from HTML, and any non-DOS system. Can we please stop posting in this off-topic thread and let it die a natural death?

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 
Does anyone know a console program runnable from DOS that prompts user to input length/width of rectangle then prints rectangles area/perimeter ?

That was the original question, which I answered.

I have no clue why he is posting under web development.

pty
Posting Pro
530 posts since Oct 2005
Reputation Points: 64
Solved Threads: 39
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You