Thursday, January 27, 2011

How Fuzzy Applied In Television

Python -> Java (POS1: 2A, 2C)

write the following Python program in Java to (add the missing headers):
 from sys import argv, stderr, stdin, stdout 

def count (inStream):
num = 0
imWort = False
sign inStream.read = (1)
eof = character == ""
while not eof:
imWort if:
if "\\ n \\ t" find (sign)> = 0.
imWort = False else
:
if "\\ n \\ t" find (sign) == -1:.
imWort = True
num = num + 1
sign inStream.read = (1)
eof = character == "" return num


if __name__ == "__main__":
outStream = stdout
if len (argv) == 1:
inStream = stdin
elif len (argv)> = 2:
inStream = open (argv [1], "r") Len
if (argv) == 3:
outStream = open (argv [2], "w") = num
count (inStream)
output = "Number =% d \\ n"% num
outStream.write (output)
What makes the program?
What can one say about the compliance program guidelines for this program (apart from the missing header)?

0 comments:

Post a Comment