<!doctype html>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<SCRIPT LANGUAGE="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
</SCRIPT>
<script>
function clientSideInclude(id, url) {
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
 if (!element) {
  alert("Bad id " + id +
   "passed to clientSideInclude." +
   "You need a div or span element " +
   "with this id in your page.");
  return;
 }
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } else {
    element.innerHTML =
   "Sorry, your browser does not support " +
      "XMLHTTPRequest objects. This page requires " +
      "Internet Explorer 5 or better for Windows, " +
      "or Firefox for any system, or Safari. Other " +
      "compatible browsers may also exist.";
  }
}
</script> 
<title>Java Review</title>
<style type="text/css">
  body,html{ height: 100% } 
  iframe {
	width: 100%;
	height: 100%;
	max-width: 600px;
	min-width: 500px;
	}
  iframe[seamless] {
    border: none;
}
</style>
</head>
<!-----<body style="margin:0px;padding:0px;overflow:hidden"> --->
<body  onresize="$('#iframe2').attr('height', $(window).height());" style="margin:0;" 
       onLoad="clientSideInclude('include2', 'code.php?f=V2.java');
               clientSideInclude('include2', 'code.php?f=runTests.java');">  
<center><h2><font color=darkblue>Java Review</font></h2></center>
<center>
<table border=0 width=90%>
<tr><td valign=top>Given the following program:
    <center>
          <iframe src="code.php?f=echo.java"  frameborder="0" scrolling="no"
                  style="overflow:hidden; 
                  display:block; height: 100%; width: 100%" height="100%" width="100%">
          </iframe>
         <p>
<!-------------
	   style="overflow:hidden; 
                  display:block; height: 100%; width: 100%" height="100%" width="100%">
	   looks better but still have right scroll bar 


           display:block; position: absolute;  height: 100%; width: 100%" height="100%" width="100%"> 
	   overlayed the table and fram
----> 
  
<!---?php
   seamless      exec('php name.php');include('./code.php?f=echo.java');     
?> --->
     </center>
     </td>
<td valign=top>
Answer the following questions:<p>
<table border=1>
<tr><td valign=top width=10% rowspan=2>Q 1:</td>
    <td valign=top >What does this program do when executed from the following command line:
        <center><font color=darkblue>java  echo</font></center>
	<p><p>
        </td></tr> 
<tr><td valign=top >
	<div align="center">
                 <a href="#" onmouseout="MM_swapImgRestore()" 
                    onmouseover="MM_swapImage('echoNone','','/dev/java/images/echoNone.jpg',1)">
                   <img src=/images/labs/revealsolutions.jpg  name="echoNone" 
                    id="Concept 3" /></a>
            </div> 
    </td>
<tr><td valign=top rowspan=2>Q 2:</td>
    <td valign=top>What does this program do when executed from the following command line:
                   <center><font color=darkblue>java  echo This old man, he played one</font></center>
		   <p><p>
                   </td></tr> 
<tr><td valign=top>
    <div align="center">
                 <a href="#" onmouseout="MM_swapImgRestore()" 
                    onmouseover="MM_swapImage('echo2','','/dev/java/images/echo2.jpg',1)">
                   <img src=/images/labs/revealsolutions.jpg  name="echo2" 
                    id="Concept 3" /></a>
            </div>
    </td>
    </tr>
<tr><td valign=top  rowspan=2>Q 3:</td><td valign=top>What does this program do when executed from the following command line:
                 <center><font color=darkblue>java  echo "This old man, he played one"</font></center>
<p><p>
                   </td></tr>
<tr><td valign=top>
	<div align="center">
                 <a href="#" onmouseout="MM_swapImgRestore()" 
                    onmouseover="MM_swapImage('echo3','','/dev/java/images/echo3.jpg',1)">
                   <img src=/images/labs/revealsolutions.jpg  name="echo3" 
                    id="Concept 3" /></a>
            </div>
     </td>
    </tr>
    </table>
  </td></tr>
</table>
<hr>
<!------------------ program 2 -------------------->
<p>
<table border=0 width=90%>
<tr><td colspan=1 valign=top >Given the following program:<p>
    <center>
      <span id="include2">
      </span>
     <!-----------
	<?php include("./code.php?f=V2.java"); ?> 

        < --#include virtual="code.php?f=V2.java" 
	<iframe src="code.php?f=V2.java" frameborder="0" scrolling="yes" seamless="seamless" scrolling="no" 
		style="display:block; width:100vh; height:100vh; overflow:hidden;">
        </iframe>
----------->
<!--------------------
scrolling="no"
                  style="overflow:hidden; 



<iframe id="iframe2" src="code.php?f=V2.java" style="width:100%;"  onload="this.height=$(window).height();"></iframe>
------------------>
<!---          <iframe src="code.php?f=V2.java" seamless frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%"></iframe>
          </iframe> --------------->
         <p>
     </center>
     </td>
     <td valign=top>Answer the folling questions:<p>
<p>
<table border=1>
<tr><td valign=top width=10% rowspan=2>Q 4:</td><td valign=top >What is the output from this program when executed from the following command line:   <center><font color=darkblue>java  V2</font></center>
		   <p><p>
                   </td>  </tr>
<tr><td valign=top >
	<div align="center">
                 <a href="#" onmouseout="MM_swapImgRestore()" 
                    onmouseover="MM_swapImage('V21','','/dev/java/images/V2-1.jpg',1)">
                   <img src=/images/labs/revealsolutions.jpg  name="V21" 
                    id="Concept 3" /></a>
            </div> 
    </td></tr>
<tr><td valign=top width=10% rowspan=2>Q 5:</td><td valign=top>What does the third line of output represent?
                   <p><p>
                   </td></tr>
<tr><td valign=top>
	<div align="center">
                 <a href="#" onmouseout="MM_swapImgRestore()" 
                    onmouseover="MM_swapImage('V22','','/dev/java/images/V2-2.jpg',1)">
                   <img src=/images/labs/revealsolutions.jpg  name="V22" 
                    id="Concept 3" /></a>
            </div>
    </td>
    </tr>
<tr><td valign=top rowspan=2>Q 6:</td><td valign=top>What is the purpose of the folling line from the vowelCount method?
                 <center><font color=darkblue>temp = s.toUpperCase()</font></center>
                 Where is toUpperCase() defined? 
<p><p>
                   </td>  </tr>
    <td valign=top>
	<div align="center">
                 <a href="#" onmouseout="MM_swapImgRestore()" 
                    onmouseover="MM_swapImage('V23','','/dev/java/images/V2-3.jpg',1)">
                   <img src=/images/labs/revealsolutions.jpg  name="V23" 
                    id="Concept 3" /></a>
            </div>
 
    </td>
    </tr>
</td></tr></table>
</table>
<hr>
<!------------------ program 3 -------------------->
<p>
<table border=0 width=90%>
<tr><td colspan=1 valign=top >Given the following program that uses a recursive method guessMyFunction called from the main progam:<p>
    <center>
    <span id="include3">
    </span>  
    <p>
    </center>
    </td>
    <td valign=top>Answer the folling questions:<p>
    <p>
<table border=1>
<tr><td valign=top width=10% rowspan=2>Q 4:</td><td valign=top >What is the output from this program when executed from the following command line:   <center><font color=darkblue>java  runTests</font></center>
		   <p><p>
                   </td>  </tr>
<tr><td valign=top >
	<div align="center">
                 <a href="#" onmouseout="MM_swapImgRestore()" 
                    onmouseover="MM_swapImage('gmf','','/dev/java/images/gmf.jpg',1)">
                   <img src=/images/labs/revealsolutions.jpg  name="gmf" 
                    id="Concept 3" /></a>
            </div> 
    </td></tr>
<tr><td valign=top width=10% rowspan=2>Q 5:</td><td valign=top>What does the third line of output represent?
                   <p><p>
                   </td></tr>
<tr><td valign=top>
	<div align="center">
                 <a href="#" onmouseout="MM_swapImgRestore()" 
                    onmouseover="MM_swapImage('V22','','/dev/java/images/V2-2.jpg',1)">
                   <img src=/images/labs/revealsolutions.jpg  name="V22" 
                    id="Concept 3" /></a>
            </div>
    </td>
    </tr>
<tr><td valign=top rowspan=2>Q 6:</td><td valign=top>What is the purpose of the folling line from the vowelCount method?
                 <center><font color=darkblue>temp = s.toUpperCase()</font></center>
                 Where is toUpperCase() defined? 
<p><p>
                   </td>  </tr>
    <td valign=top>
	<div align="center">
                 <a href="#" onmouseout="MM_swapImgRestore()" 
                    onmouseover="MM_swapImage('V23','','/dev/java/images/V2-3.jpg',1)">
                   <img src=/images/labs/revealsolutions.jpg  name="V23" 
                    id="Concept 3" /></a>
            </div>
 
    </td>
    </tr>
</td></tr></table>
</table>
<hr>