# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

4 Pages

### Test1

Course: CS 310, Fall 2009
School: Christopher Newport...
Rating:

Word Count: 335

#### Document Preview

Computer Name________________ Science 310 Fall 03 Test 1 Closed Book. Closed Notes. I. Java ( 30 points 15/15) A. Show the results produced by the following program: public class Question1A { public Question1A () { this(2) ; } public Question1A( int v1 ) { b=v1; a=b+10; c=a+c; } // Instance variables private int b; public int a; // Class variable and class method public static int c=5; private int val() { return...

Register Now

#### Unformatted Document Excerpt

Coursehero >> Virginia >> Christopher Newport University >> CS 310

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Computer Name________________ Science 310 Fall 03 Test 1 Closed Book. Closed Notes. I. Java ( 30 points 15/15) A. Show the results produced by the following program: public class Question1A { public Question1A () { this(2) ; } public Question1A( int v1 ) { b=v1; a=b+10; c=a+c; } // Instance variables private int b; public int a; // Class variable and class method public static int c=5; private int val() { return c; } private int valb() { return b; } private int vala() { return a; } // Another "special" class method public static void main(String args[]) { Question1A x=new Question1A(1); Question1A y=new Question1A(); System.out.println("x=" + x.val() ); System.out.println( x.vala() ); System.out.println( x.valb() ); System.out.println("y=" + y.val() ); System.out.println( y.vala() ); System.out.println( y.valb() ); System.exit(0); } // no semi-colon OUTPUT(B): OUTPUT(A): } B. Repeat the problem removing the "static" attribute of the member "c" II. Tannenbaum code examples (70 points 15/20/15/20) A. Addressing techniques Program Question2(input, output) b=1; const var c; procedure a ( x: integer, var y: integer) (* y reference *) var float m; begin end; begin (* main *) end. (matching) For each variable/symbol, indicated the most likely addressing technique would be used at the assembly level. ___ b ___ c ___ x ___ y ___ m B. Given the following assembly language, provide pseudocode that reflects the most likely higher-level language program which would have generated this program. Initially SP=4000 AC = 0 Y=2 K = 4021 (1) (2)L1: (3) JUMP A DESP 1 LOCO 12 A. direct B. local C. local and indirect D. constant (e.g. LOCO) (4) (5) (6) (7)A: (8) (9) (10) (11) ADDL Y INSP 1 RET LOCO 7 STOD K PUSH K CALL L1 STOP C. ...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Christopher Newport University - CS - 310
Computer Science 310 Fall 2000Test 2SolutionsI. With static rules: x=5 With dynamic rules: x=10Visibility of variablesVariabledeclared inasub1ysub1zsub1bsub2xsub3wsub30II.Start Symbol: &lt;S&gt;non-terminals:
Christopher Newport University - CS - 310
Computer Science 310 Fall 2000Test 1SolutionsI.m can call mb can call b c mf can call f z b mmain can call m b zIllegal references to variables:j:=3; CIRCLEj:=3;i:=3; CIRCLEx:=3;i:=3; CIRCLEi:=3; CIRCLE
Christopher Newport University - CS - 310
Intro to Java labVariables and DataNOTE: TO BE DONE ON THE SUN MACHINES IN HUNTER CREECH!This lab will simply show an example very similar to theone in your text. The text example (CH. 2) reads a set of integers, calculates the average and ou
Christopher Newport University - CS - 310
Intro to Java labTEXT IONOTE: TO BE DONE ON THE SUN MACHINES IN HUNTER CREECH!This lab will take you through a few simple activites which willexpose you to the basic structure of a java application . NOTan applet.There are a number of issu
Christopher Newport University - CS - 310
Computer Science 310Fall 2003Test2I. pascalcadasmalltalkfortranlispcobolpl/1algolpl/1II.1/500x10^6 = .2x10^-8 = 2 x 10^-9 = 2 nanosecs1/10^9 = 10^-9 = 1 nanosec1/(2.5 x 10^9) = .4 x 10^9 = .4 nanosecs = 400 picosecs--4 x 1 n
Christopher Newport University - CS - 310
I. What is the most OBVIOUS example of static global memory allocation? Be specific. It might not be so obvious, but the first guess would likely be &quot;a&quot; and/or &quot;b&quot;. The question as to whether &quot;a&quot; and &quot;b&quot; are allocated statically is up to deb
Christopher Newport University - CS - 310
CS310 Test 1 solutionsI. Java Part A. X= 28 11 1 Y= 28 12 2 (note that C is static, one copy for all, once &quot;Y&quot; updates the value for C, X's C (the same one) is also updated). Part B. X= 16 11 1 Y= 17
Christopher Newport University - CS - 310
CS 310 test 1 solutionsI.4(3)+(4)i(4)+(3)i(-4)+(-3)i57Using static:To provide access to methods or properties withouthaving to declare an object.Main()?One can't (doesn't have to) declare an object containingthe main in order to run
Christopher Newport University - CS - 310
Tannenbaum Simulator LabPURPOSE:1. Create some familiarity with running a simulator and specifically to understand some of the peculiarities.2. Provide some specific examples which will illustrate how the registers and memory.3. Provide e
Christopher Newport University - CS - 310
{dgame@sappho:~ } g+ fork.C{dgame@sappho:~ } a.outabcabcabcabc {dgame@sappho:~ } cat fork.C#include &lt;iostream.h&gt;#include &lt;sys/types.h&gt;#include &lt;unistd.h&gt;void main(){ cout &lt; &quot;a&quot; ; fork(); cout &lt; &quot;b&quot; ; fork(); cout &lt; &quot;c&quot;;}{dgame@sa
Christopher Newport University - CS - 310
{dgame@sappho:~ } g+ fork.C{dgame@sappho:~ } a.outabcbccc{dgame@sappho:~ } cat fork.C#include &lt;iostream.h&gt;#include &lt;sys/types.h&gt;#include &lt;unistd.h&gt;void main(){ cout &lt; &quot;a&quot; &lt; endl ; fork(); cout &lt; &quot;b&quot; &lt; endl ; fork(); cout &lt; &quot;c
Christopher Newport University - CS - 446
Active XMicrosofts Answer to Dynamic ContentReference: Using Active X by Brian Farrar QUE pub. @96Static Content1 Client 2 www Internet 2 1 Server1- Browser asks for a page 2- Server returns page and Browser displaysCGIs1 Client 3 www Inter
Christopher Newport University - CS - 446
Linux SecurityAn overview notes from Linux Network Security HowTOBasic Approach Focus on OSI model Most initial probes are service-level attacks enter through a port try to compromise the server use the &quot;server&quot; to gain access to other info a
Christopher Newport University - CS - 336
LinuxSetting up your networkBasic Approaches Configure during installation Disadvantage -&gt; not able to redo easily Advantage-&gt; holds your hand Configure after installation Disadvantage -&gt; collision with other config tools Advantage-&gt; fairly
Christopher Newport University - CS - 335
ProtocolsDefining Interactions VERTICALApplication Presentation Session Transport Network Data Link PhysicalOK Its Done or Sorry I couldnt Please do this for meHorizontal Interactionshttp request Application Presentation Session Transport Netw
Christopher Newport University - CS - 502
LAN PerformanceFrom Stallings text on LANsCSMA/CDWhat is the maximum utilization possible for n nodes?A= P=Probability of ONE node transmitting Probability each node transmittingMaximize A with respect to P n 1 A = P (1 - P) n -1 = n
Christopher Newport University - CS - 502
SocketsA popular API for client-server interactionComplete view of a socketApplication Presentation Session Transport Network Data Link Physical Applications talk to each other via APIs like sockets. Sockets provide the interface to the other lay
Christopher Newport University - CS - 502
Error DETECTION &amp; CORRECTIONDetection in oral communicationNo, UCLA won today Sender No, you see LA won today ReceiverIn verbal communication we use the most likely interpretation and only question when there seem to be ambiguities or inconsiste
Christopher Newport University - CS - 502
EncodingHow is information represented?Way of looking at techniquesData MediumDigitalNRZ Manchester Differential ManchesterAnalogPhase Coded Modulation (digitized voice)DigitalAnalogASK FSK PSKmodemsAM/FM radio TelevisionAnalog
Christopher Newport University - CS - 502
SocketsA popular API for client-server interactionComplete view of a socketApplication Presentation Session Transport Network Data Link Physical Applications talk to each other via APIs like sockets. Sockets provide the interface to the other lay
Christopher Newport University - CS - 502
Computer Science 502Objectives and Main Areas of Coverage Basic Concepts OSI Analysis of Networks Client-serversBasic ConceptsCommunication is fundamentally complicated.transmitter MEDIUM receiverI told you before!I didn't understand.
Christopher Newport University - CS - 502
Internet (IP) AddressesNaming every interface!Naming Naming every interface in the world is not easy Networks evolved from vendors with DIFFERENT naming schemes. Use the same scheme compilers use to solve the one language many processors issue
Christopher Newport University - CS - 502
LAN PerformanceFrom Stallings text on LANsCSMA/CDWhat is the maximum utilization possible for n nodes?Determine Optimal Behavior of Each Node1. Calculate probability of one node transmitting. 2. Optimize that probability with respect to N (it
Christopher Newport University - CS - 502
IP BasicsIPNetwork ARP Link PhysicalICMP RoutingTablesIP Basics IP encapsulates TCP IP packets travel through many different routers (hops) before reaching its destination MTU variation at the physical layer requires IP to fragment the mess
Christopher Newport University - CS - 502
Repeaters and BridgesRelay StationsRepeaters Add delays comparable to BIT times Clean and reamplify the digital signal Do not examine the contents of the message Function at the physical level of OSIOther Layers Other LayersREPEATERphysica
Christopher Newport University - CS - 502
Queueing SystemsThey're EVERYWHERE!Basic ConceptService.RequestRequestRequestDoneNumerous requests made for service Lines back up waiting for service Waiting times increase non-linearlyConsider a perfect system Customers arrive in
Christopher Newport University - CS - 502
LANsMedia Access Control Step 1 in Sharing ResourcesLots of Strategies Ethernet Token Ring Token Bus ATM DSL FDDI Sonet .General Interest Qualitative understanding of the function Comparison/Contrast of a few strategies Design tradeo
Christopher Newport University - CS - 502
Transmission ModesDifferent ways of characterizing the transmissionTiming of the transmission of the data bits0 1 0 1 1 0 1 0 1 1 Serial11010 Data bits transmitted at different times One bit after the other0 1 0 1 1 Parallel Multiple b
Christopher Newport University - CS - 502
ProtocolsBasicsDefining Interactions VERTICALApplication Presentation Session Transport Network Data Link PhysicalOK It's Done or Sorry I couldn't Please do this for meHorizontal Interactionshttp request Application Presentation Session Tran
Christopher Newport University - CS - 502
Transmission ModesDifferent ways of characterizing the transmissionTiming of the transmission of the data bits0 1 0 1 1 0 1 0 1 1 Serial11010 Data bits transmitted at different times One bit after the other0 1 0 1 1 Parallel Multiple b
Christopher Newport University - CS - 502
RoutingGoing from one network to the nextWhere is routing handled? IP serves the functions of routing universal naming Identification is easiest if naming has uniformity Need a function/service to map IP addresses to MAC (e.g. ethernet) addr
Christopher Newport University - CS - 502
Protocol StrategiesIdle RQ (Stop-and-Wait)Transmission Initiated Ack Received Send NextSend NSend N+1 Fig 1.23Message is lostSend NRepeat NSend N+1Fig 1.23Ack is lostSend NRepeat NSend N+1Fig 1.23Message PropagatesFirst
Christopher Newport University - CS - 502
LANsMedia Access Control Step 1 in Sharing ResourcesLots of Strategies Ethernet Token Ring Token Bus ATM DSL FDDI Sonet .General Interest Qualitative understanding of the function Comparison/Contrast of a few strategies Design tradeo
Christopher Newport University - CS - 502
The OSI ModelA layman's view of the internetOSI StructureApplication Presentation Session Transport Network Data Link PhysicalEach layer has a specific function. It relies on the layer below to provide a service.Please do this for meOK It's
Christopher Newport University - CS - 502
ProtocolsDefining Interactions VERTICALApplication Presentation Session Transport Network Data Link PhysicalOK Its Done or Sorry I couldnt Please do this for meHorizontal Interactionshttp request Application Presentation Session Transport Netw
Christopher Newport University - CS - 502
Calculating aFrames on a linka Used as a term in analyzing many network characteristics Has a physical interpretation Represents the number of frames on a link.LinkWorkstation AWorkstation BConnection between workstations/computersMul
Christopher Newport University - CS - 502
Client-Server ApplicationsIndirect Top Level InteractionApplication ApplicationApplication ApplicationApplication ApplicationClient asks server to connectApplication ClientConnect requestApplication ServerConnect requestSocket provide
Christopher Newport University - CS - 502
Cable ModemsFrom a presentation by Donner GrigsbyCPSC 611What are Cable Modems? The cable TV plant dedicates a standard cable TV channel to data transfer for Internet and multimedia services. A computer equipped with a cable modem is then conne
Christopher Newport University - CS - 446
Firewalls and Info Services Prevent unathorized access between nets Most of the protection is based upon examination of the IP packets There is always a tradeoff between security and ease of usePROTECToutside and outside inside insidePrimary
Christopher Newport University - CS - 446
EncryptionAn OverviewFundamental problems Internet traffic goes through many networks and routers Many of those networks are broadcast media Sniffing allows for many to see transmissions Tamper/alter transmission Spoof identitiesSecurity I
Christopher Newport University - CS - 446
Microsoft COMComponent Object ModelMicrosoft CorporationTMWhat is COM? Build software from parts, not from scratch A framework for creating and using componentsMakes software easier to write and reuse Provides widest choice in services, t
Christopher Newport University - CS - 446
TCP/IP BasicsA review for firewall configurationConfiguring a firewall Primary approach to configuring a firewall Study service IP ADDRESSES PORTS Set up rules for allowing or denying access to the services you want utilized. Problem: Some
Christopher Newport University - CS - 446
IP MasqueradingHomes and Businesses:When you only have one IP but you have LOTS of machinesThe problem Extra IPs are an additional cost of you internet service. Masquerading lets you hook up multiple machines to the same IP Some companies wan
Christopher Newport University - CS - 446
SambaIntegrating SMB file systems with UNIXSamba Provides a file server compatible with Windows 9x and NT . SMB Can function in NETBIOS name browsing as seen in network neighborhood Provides for authentication of users Provides an NT domain se
Christopher Newport University - CS - 446
inetd.Server of Servers Looks at a number of ports Determines when a service is needed on any of those ports Calls the appropriate server Restarts new server for each client ( nowait ) when the previous server dies (wait ) Interacts with sysl
Christopher Newport University - CS - 446
#E#1#5#P#(#(#y#[# # # # # # # # # # # # # # # #N# #p# # #P# # ## # # # # # # # # # # # # # # # # ## # # f~c# # # # ? # # # # # # # # # # # ## # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # # # # # # # # # # # # #
Christopher Newport University - CS - 446
#E#1#P#(#(#y#[# #V# #r# #5# # # # #uar fea red lesers chi# #ef##_ # # # # ## # ## # # ## # # # ## # # ## # # # # # # ## # ## # # # ## # ## # # #K#DY # # # ## ## # ## # # # # ## # ### # ## # ## # # d# # # # # # j#i i# }#@#s.#(#j#S#&amp;#g\$#\$#@#\$#\$#`#\$#&amp;
Christopher Newport University - CS - 446
Linux Security ConfigurationTCP WrappersAt the machine levelCheck Request ServerWhat checks the request? External Firewalls (not here) Hosts Allow/Deny Individual servers Firewall software ipchains iptables shorewall(X)inetd based req
Christopher Newport University - CS - 446
SyslogdTracking system eventsLog servers Applications are constantly encountering events which should be recorded users attempt to login with bad passwords servers cant properly start disk runs out of space and others Many system servers ar
Christopher Newport University - CS - 446
Scaling Service RequestsLinux: ipvsadm &amp; iptoipInitiallyOutside Client Gateway Outside Client137.155.37.33Inside Server137.155.37.34At this stage the server is able to keep up with client requests at a satisfactory level! No masquerading as
Christopher Newport University - CS - 446
KerberosAuthenticating Over an Insecure NetworkInitial requestAuthentication Server (only real user can decode) user to service User key Session key Service nameuserService key Session key User nameserviceKerberos Server User and Server D
Christopher Newport University - CS - 446
An Overview of ActiveXCharlie Kindel Architect &amp; Chief Technical Advisor Microsoft Developer Relations GroupOutline WhatisActiveX? TheComponentObjectModel CurrentStatusWhat is ActiveX? Amarketingnameforasetof technologiesandservices,allbased
Christopher Newport University - CS - 446
Spoofing and SniffingNotes from: Internet Security Professional Reference, 2nd edNational Computer Security Association New Riders PublishingSniffinglogin: dgame passwd: #SNIFFERSpoofingDavid is that you?Yes I'm here!AaronTomDavid
Christopher Newport University - CS - 446
Apache Access ControlsWays to control Allow/Deny access control By IP By domain name Password Apache managed passwords RealmsAllow / Deny ControlAllow Deny Order Three basic directives Order Allow and Deny directives Order states wh
Christopher Newport University - CS - 446
Apache ConfigurationSetting up a web serverBasic Server Facts Runs on port 80 Server application -&gt; httpd Richly configurable Many defaults will let it run out of the box Runs on many platforms primarily unix (linux) also on Windows Docum
Christopher Newport University - CS - 446
1The following document is Chapter 1 of the Concepts and Planning book that is included in the online documentation set that is included on the compact disc and is also available in book format.C H A P T E R1Managing Windows NT Server Domains
Christopher Newport University - CS - 446
Use and Configuration Of Linux-Mandrake Multi-network Firewall Overview:To the average user, the functionality of the MNF software package can be a bit overwhelming. The purpose of this paper is to describe some of the important features of the syst
Christopher Newport University - CS - 231
Computer Science 231L C+ Programming Lab II Spring 2003INSTRUCTOR David Game PHONE 594-7241 (office) 594-7065 (secretary) OFFICE Gosnold 226 OFFICE HOURS see web site TEXTS J.G. Hardie, CPSC 231 Lab Manual Dietel and Dietel, C+, How to Program, Pren
Christopher Newport University - CS - 336
#! /bin/bash # # network Bring up/down networking # # chkconfig: 2345 10 90 # description: Activates/Deactivates all network interfaces configured to \ # start at boot time. # # BEGIN INIT INFO # Provides: \$network # END INIT INFO # Source function l
Christopher Newport University - CS - 335
Ethereal Lab: Getting StartedVersion: July 2005 2005 J.F. Kurose, K.W. Ross. All Rights ReservedComputer Networking: A Topdown Approach Featuring the Internet, 3rd edition.Tell me and I forget. Show me and I remember. Involve me and I understa
Christopher Newport University - CS - 335
Repeaters and BridgesRelay StationsRepeaters Add delays comparable to BIT times Clean and reamplify the digital signal Do not examine the contents of the message Function at the physical level of OSIOther Layers Other LayersREPEATERphysica