Difference between revisions of "Be the Machine - if"

From Progzoo
Jump to: navigation, search
(Problem 1)
 
(One intermediate revision by the same user not shown)
Line 13: Line 13:
 
       String [] wrds = line.split("\t");
 
       String [] wrds = line.split("\t");
 
       oneLine(wrds[0], wrds[1],Integer.parseInt(wrds[2]),
 
       oneLine(wrds[0], wrds[1],Integer.parseInt(wrds[2]),
         Long.parseLong(wrds[3]));  
+
         Long.parseLong(wrds[3]));
 
     }
 
     }
 
   }
 
   }
Line 93: Line 93:
 
               int area, long pop){
 
               int area, long pop){
 
   if (region.equals("Africa"))
 
   if (region.equals("Africa"))
     System.out.println(name);
+
     System.out.println(name);  
 
}
 
}
 
</prog>
 
</prog>
 
</question>
 
</question>
 +
 
==Problem 2==
 
==Problem 2==
 
<question className="Cia" title="What's the output?" copyfile="bbc4.txt">
 
<question className="Cia" title="What's the output?" copyfile="bbc4.txt">

Latest revision as of 10:32, 15 July 2010

Predict the output of each of the following programs.

name region area pop
Chad Africa 1280 9
Cuba Americas 111 11
Fiji Asia-Pacific 18 1
Iran Middle East 1650 71
Iraq Middle East 438 27
Laos Asia-Pacific 238 6
Mali Africa 1250 14
Oman Middle East 310 3
Peru South America 1280 28
Togo Africa 57 5

Problem 1


[Font] [Default] [Show] [Resize] [History] [Profile]

Problem 2


[Font] [Default] [Show] [Resize] [History] [Profile]

Problem 3


[Font] [Default] [Show] [Resize] [History] [Profile]

Problem 4


[Font] [Default] [Show] [Resize] [History] [Profile]

Problem 5


[Font] [Default] [Show] [Resize] [History] [Profile]

Problem 6


[Font] [Default] [Show] [Resize] [History] [Profile]

Problem 7


[Font] [Default] [Show] [Resize] [History] [Profile]

Problem 8


[Font] [Default] [Show] [Resize] [History] [Profile]