0

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

4
Contributors
7
Replies
8
Views
10 Years
Discussion Span
Last Post by pty
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.

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.

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

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.

0

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

0

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}"
0

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?

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.