2 Pages

lab24i

Course: COMP SCI 543, Spring 2010
School: Brown College
Rating:
 
 
 
 
 

Word Count: 267

Document Preview

Goal ComputerScienceI Lab24IMATRIXMATH LabValue120 Lab : The lab was designed to teach you more about parameters. Read in matrices and perform math operations on them. Lab Description : Sample Output : Files Needed :: ThreeDRay.java Lab24i.java How many matrices do you wish to enter? :: 3 What is the size of matrix 0 : 2 Enter Enter Enter Enter a a a a value value value value for for for for spot spot spot...

Register Now

Unformatted Document Excerpt

Coursehero >> Minnesota >> Brown College >> COMP SCI 543

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.
Goal ComputerScienceI Lab24IMATRIXMATH LabValue120 Lab : The lab was designed to teach you more about parameters. Read in matrices and perform math operations on them. Lab Description : Sample Output : Files Needed :: ThreeDRay.java Lab24i.java How many matrices do you wish to enter? :: 3 What is the size of matrix 0 : 2 Enter Enter Enter Enter a a a a value value value value for for for for spot spot spot spot 0 0 1 1 0 1 0 1 :: :: :: :: 1 1 1 1 BONUS OPTION Matrix Multiplication Matrix Multiplication Logic [12] X [56] [34] [78] [1*5+2*7][1*6+2*8 [3*5+4*7][3*6+4*8 Final Matrix [ 19 22 ] [ 43 50 ] for loop r rows for loop c cols for loop i inside ] ] ThreeDRay before setting mat at spot 0 mat 0 mat 1 mat 2 ThreeDRay after setting mat at spot 0 mat 0 row 0 11 row 1 11 mat 1 mat 2 What is the size of matrix 1 : 2 Enter Enter Enter Enter a a a a value value value value for for for for spot spot spot spot 0 0 1 1 0 1 0 1 :: :: :: :: 2 2 2 2 ThreeDRay before setting mat at spot 1 mat 0 row 0 11 row 1 11 mat 1 mat 2 ThreeDRay after mat 0 row 0 row 1 mat 1 row 0 row 1 mat 2 setting mat at spot 1 1 1 2 2 1 1 2 2 A+ Computer Science Matrices www.apluscompsci.com What is the size of matrix 2 : 3 Enter Enter Enter Enter Enter Enter Enter Enter Enter a a a a a a a a a value value value value value value value value value for for for for for for for for for spot spot spot spot spot spot spot spot spot 0 0 0 1 1 1 2 2 2 0 1 2 0 1 2 0 1 2 :: :: :: :: :: :: :: :: :: 3 3 3 3 3 3 3 3 3 ThreeDRay before setting mat at spot 2 mat 0 row 0 11 row 1 11 mat 1 row 0 22 row 1 22 mat 2 ThreeDRay after mat 0 row 0 row 1 mat 1 row 0 row 1 mat 2 row 0 row 1 row 2 setting mat at spot 2 1 1 2 2 3 3 3 1 1 2 2 3 3 3 3 3 3 Adding matrix at 0 and matrix at 1 33 33 A+ Computer Science Matrices www.apluscompsci.com
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:

Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importjava.util.Scanner; importjava.util.Arrays; importstaticjava.lang.System.*; publicclassLab24i cfw_ publicstaticvoidmain(Stringargs[]) cfw_ Scannerkeyboard=newScanner(in); out.print("Howmanymatri
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importstaticjava.lang.System.*; publicclassMatrixFunHouse cfw_ privateint[][]mat; publicMatrixFunHouse() cfw_ publicMatrixFunHouse(intnumRows,intnumCols) cfw_ publicvoidsetSize(intnumRows,intnumCol
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importjava.util.Scanner; importstaticjava.lang.System.*; publicclassPascalsTriangle cfw_ privateint[][]mat; publicPascalsTriangle() cfw_ publicPascalsTriangle(intsize) cfw_ publicvoidcreateTriangle
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab publicclassThreeDRay cfw_ privateint[][][]matrices; /addconstructors publicvoidsetMatrixSize(intwhichMat,introwsize,intcolSize) cfw_ publicvoidsetMatrix(intwhichMat,int[][]mat) cfw_ publicint[][]ge
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importjava.util.Scanner; importstaticjava.lang.System.*; publicclassTicTacToe cfw_ privatechar[][]mat; publicTicTacToe() cfw_ publicTicTacToe(Stringgame) cfw_ publicStringgetWinner() cfw_return";
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importjava.util.Arrays; publicclassTwoDRay cfw_ privateint[][]matrix; /addconstructors publicvoidsetRowSize(intr,intsize) cfw_ publicvoidsetRow(intr,int[]row) cfw_ publicint[]getRow(intr) cfw_ retu
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importjava.lang.System; importjava.lang.Math; publicclassArrayFunHouse cfw_ /instancevariablesandconstructorscouldbeused,butarenotreallyneeded /getSum()willreturnthesumofthenumbersfromstarttostop,not
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importjava.lang.System; importjava.lang.Math; publicclassArrayFunHouseTwo cfw_ /instancevariablesandconstructorscouldbeused,butarenotreallyneeded /goingUp()willreturntrueifallnumbersinnumArray /arein
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importstaticjava.lang.System.*; importjava.util.Arrays; importjava.util.Scanner; publicclassArrayStats cfw_ privateint[]array; /constructor /setmethod publicintgetNumGroupsOfSize(intsize) cfw_ intcnt
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importjava.util.Scanner; publicclassBiggest cfw_ privatedouble[]decRay; publicBiggest(intsize,Stringlist) cfw_ publicvoidsetNumbers(intsize,Stringlist) cfw_ /useaScannertochopuplist /putthenumsintod
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab publicclassFibonacci cfw_ privateint[]list; /constructors /setmethod /getmethod /toString
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importjava.lang.System; importjava.lang.Math; importjava.util.Scanner; publicclassGrades cfw_ privatedouble[]grades; /constructor/setmethodprivatedoublegetSum() cfw_ doublesum=0.0;returnsum; publ
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importjavax.swing.JFrame; publicclassGraphicsRunnerextendsJFrame cfw_ privatestaticfinalintWIDTH=800; privatestaticfinalintHEIGHT=600; publicGraphicsRunner() cfw_ super("GraphicsRunner"); setSize(WID
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importjava.util.Scanner; publicclassHistogram cfw_ privateint[]numCount; /constructor /setmethod /toStringmethod
Brown College - COMP SCI - 543
ComputerScienceILab14AARRAYFUNHOUSELabValue100Lab Goal :This lab was designed to teach you how to use an array.Lab Description :Write a method to sum up a section of a provided array and another method to count up how many of a certain number occur
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importjava.util.Arrays; publicclassLab14a cfw_ publicstaticvoidmain(Stringargs[]) cfw_ int[]one=cfw_4,10,0,1,7,6,5,3,2,9; System.out.println(Arrays.toString(one); System.out.println("sumofspots36="+
Brown College - COMP SCI - 543
ComputerScienceILab14BGOINGUPORDOWNLabValue100Lab Goal :This lab was designed to teach you how to use an array.Lab Description :Take in any integer array and determine if that array is going up or going down. An array that is going up will contain
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importjava.util.Arrays; publicclassLab14b cfw_ publicstaticvoidmain(Stringargs[]) cfw_ int[]one=cfw_1,2,3,4,5,6,7,8,9,10; int[]two=cfw_1,2,3,9,11,20,30; int[]three=cfw_9,8,7,6,5,4,3,2,11,2; int[]four
Brown College - COMP SCI - 543
ComputerScienceI Lab14CBIGGESTNUMBERLabValue100Lab Goal :This lab was designed to teach you how to use an array. Instantiate an array, load it with values, and then find which of the array values isLab Description :the largest.Sample Data :5 154
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab publicclassLab14c cfw_ publicstaticvoidmain(Stringargs[]) cfw_ Biggesttest=newBiggest(5,"154245154158540"); System.out.println(test); System.out.println("biggest="+test.getBiggest()+"\n\n"); /addmore
Brown College - COMP SCI - 543
ComputerScienceILab14DGRADESLabValue100Lab Goal :This lab was designed to teach you how to use an array.Lab Description :Instantiate an array, load it with values, total up all of the values in the array. Finally, find the average of all of the val
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab publicclassLab14d cfw_ publicstaticvoidmain(Stringargs[]) cfw_ /addtestcases
Brown College - COMP SCI - 543
ComputerScienceILab14EHISTOGRAMLabValue100Lab Goal :This lab was designed to teach you how to use an array.Lab Description :Take a list of numbers that range in value from 0 to 9 and output how many occurrences of each number exist.Sample Data :1
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab publicclassLab14e cfw_ publicstaticvoidmain(Stringargs[]) cfw_ /addtestcases
Brown College - COMP SCI - 543
ComputerScienceILab14FFIBONACCILabValue120Lab Goal :problems.The lab was designed to teach you how to use arrays to simplify solving more complexLab Description :Generate a Fibonacci sequence. Each number in the Fibonacci sequence is the sum of th
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab publicclassLab14f cfw_ publicstaticvoidmain(Stringargs[]) cfw_ /testcases
Brown College - COMP SCI - 543
ComputerScienceILab14GGROUPCOUNTERLabValue120Lab Goal :problems.The lab was designed to teach you how to use arrays to simplify solving more complexLab Description :Given a provided array, determine how many groups of a specified size exist. For t
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab publicclassLab14g cfw_ publicstaticvoidmain(Stringargs[]) cfw_ /addtestcases
Brown College - COMP SCI - 543
ComputerScienceILab14HTHETREELABLabValue120Lab Goal :problems.The lab was designed to teach you how to use arrays to simplify solving more complexLab Description : Sample Data :See belowUsing graphics, polygons, and arrays, draw the tree shown be
Brown College - COMP SCI - 543
ComputerScienceILab14IROMANNUMERALSLabValue120Lab Goal :problems.The lab was designed to teach you how to use arrays to simplify solving more complexLab Description :operations.In this program, you are to create a Roman Numeral class to handle ro
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importstaticjava.lang.System.*; publicclassLab14i cfw_ publicstaticvoidmain(Stringargs[]) cfw_ RomanNumeraltest=newRomanNumeral(10); out.println("10is"+test.toString(); test.setNumber(100); out.print
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importstaticjava.lang.System.*; publicclassRomanNumeral cfw_ privateIntegernumber; privateStringroman; privatefinalstaticint[]NUMBERS=cfw_1000,900,500,400,100,90, 50,40,10,9,5,4,1; privatefinalstatic
Brown College - COMP SCI - 543
/A+ComputerSciencewww.apluscompsci.com /Name /Date /Lab importjava.awt.Graphics; importjava.awt.Color; importjava.awt.Polygon; importjava.awt.Font; importjava.awt.Canvas; publicclassTreeextendsCanvas cfw_ publicTree() cfw_ setBackground(Color.WHITE); pub
Brown College - LATIN - 142
223 - And now there was an end, when Jupiter looking down from the highest Aether224 - On the sail covered sea and the lying lands225 - and the sea shores and the widespread people, thus on the summit of the sky226 - he stood, and he fixed his lights (
CSU Northridge - KIN - 345
chapter1Structure and Function of Exercising Muscle1TypesofMuscles Smooth Cardiac Skeletal2TheBasicStructureofSkeletalMuscle3MuscleFiber Musclecell Longest=12cm(~500,000sarcomeres) Diameter=10to120m #/muscle=several100to>1,000,0004Structureofa
Grand Canyon - RELIGION - 255
Spending Time With God For in mine holy mountain, in the mountain of the height of Israel, saith the Lord GOD, there shall all the house of Israel, all of them in the land, serve me: there will I accept them, and there will I require your offerings, and t
U. Houston - ECE - 2317
ECE 2317 Applied Electricity and Magnetism Fall 2011 Homework #1Date Assigned: Jan. 20 Due Date: Jan. 27 1. A surface charge density s = 5 x 2 ( y 1) [C/m2] exists on the xy plane. Find the total charge that lies within the rectangle defined by the verti
CSU Northridge - KIN - 345
chapter2Fuel for Exercising Muscle: Metabolism and Hormonal ControlWhat is Metabolism? Chemical reactions (rxn) in the body Purpose of chemical reactions: Extract energy (E) from nutrients Use E for work Store excess E for later use Two types of che
Bradford School of Business - BDS - 1066
Chapter 16 Capital Structure Decisions: The BasicsANSWERS TO END-OF-CHAPTER QUESTIONS16-1a. Capital structure is the manner in which a firms assets are financed; that is, the right-hand side of the balance sheet. Capital structure is normally expressed
Wayne State University - BIO - 151
Study guide 17 Question 1 No visible cytoplasmic granules are present in _. Answer * monocytes basophils eosinophils neutrophils 0 points Question 2 A condition of leukocytosis indicates over 11,000 white blood cells per cubic millimeter in the blood. Ans
Bradford School of Business - BDS - 1066
Review Problems of Chapter 171. For the following network diagram, determine both the critical path and the expected project duration. The numbers on the arrows represent expected activity times.Solution:Path 124689 125689 125789 13789Expected Path Ti
Wayne State University - BIO - 151
Study guide 14 Question 1 Cranial nerves III, VII, and IX supply the entire parasympathetic innervation of the head; however, only the preganglionic fibers lie within these three pairs of cranial nerves. Answer True False Question 2 Acetylcholine is the s
Central Connecticut State University - FIN - 320
Nabila Dehlavi 11/11/10 Weekly Assignment # 6bChapter 16Question: 1 Diversification Benefits. How does the diversification of a portfolio change its expected returns and expected risks? Is this in principle any different for internationally diversified
Central Connecticut State University - FIN - 320
Chapter 1 QUESTIONS: 1. Globalization and the MNE. The term globalization has become very widely used in recent years. How would you define it? Globalization as producing where it is most cost-effective, selling where it is most profitable, and sourcing c
Central Connecticut State University - FIN - 320
Chapter 7 Questions: 1. Term Forecasting. What are the major differences between short-term and long-term forecasts for the following: A fixed exchange rate & A floating exchange rate? Long-run forecasts may be motivated by a multinational firm's desire t
Central Connecticut State University - FIN - 320
Briefly summarize the article and the issue of the impact of Islamic law on debt markets in the Middle East. Islamic Bond Decree Cripples Sukuk, Imperils Projects is a very wise way to explain the situation in this article. This article is basically expla
Central Connecticut State University - FIN - 320
Inflation is a rise in the general level of prices of goods and services in an economy over a period. Summarize the article about how some countries want to create a new global currency. This article talks about China, Russia, and some other countries wan
Central Connecticut State University - FIN - 320
1. Please inquire about any terms or concepts mentioned in the article that you are unfamiliar with or don't understand. Exploitation: To take advantage of (a person, situation, etc), esp unethically or unjustly for one's own ends Evasion: an act or insta
Central Connecticut State University - FIN - 320
Delegation: Authorizing subordinates to make certain decisions Rugged: Tempestuous; stormy Terrain: An area of land; ground Compare and contrast the Icelandic financial crisis and collapse to those in Southeast Asia, Russia and Argentina in the late 90s a
Central Connecticut State University - FIN - 320
Chapter 10: Operating ExposureOperating exposure (Economic Exposure, Competitive exposure, or Strategic exposure): Change in present value of firm due to effects on its operations caused by unexpected exchange rate changes - Change in sales, price, or co
Central Connecticut State University - FIN - 320
Chapter 11Question: 3. The Central Problem. What is the central problem in consolidating the financial statement of a foreign subsidiary? The central problem arises from the fact that exchange rates change from one time period to another, combined with t
Central Connecticut State University - FIN - 320
Chapter # 3 Questions: 4. The Impossible Trinity. Explain what the term impossible trinity means and why it is true. Exchange rate stability: Countries with floating rate regimes can maintain monetary independence and financial integration but must sacrif
Central Connecticut State University - FIN - 320
Chapter5 Questions4. Transaction.Defineeachofthefollowingtypesofforeignexchangetransactions. a. Spot:participantsofspotmarketarecommercialbanks,brokers,andcustomersofcommercialandcentralbanks.i. immediatetransaction ii. recordedby2ndbusinessday b. Outr
Central Connecticut State University - FIN - 320
Chapter9TransactionExposureForeignExchangeExposureForeignexchangeexposureisthepotentialforfirmvalueofa MNEtochangeduetochangesinexchangerates cashflowchanges assetvaluechanges liabilityvaluechanges Foreignexchangeexposuremustbemeasuredandmanagedby MNEm
Central Connecticut State University - FIN - 320
Chapter10OperatingExposureOperatingExposureOperatingexposure:Changeinvalueoffirmduetoeffects onits operationscausedbyunexpectedexchangeratechanges changeinsales,priceorcosts changeincompetitioninforeignmarkets changeincompetitionindomesticmarkets chang
Central Connecticut State University - FIN - 320
Chapter11TranslationExposureTranslationExposureTranslationExposure:changeinnetworthduetochangein homecurrencyvalueofforeignassetsandliabilities foreigncurrencyappreciates(depreciates),foreign assets&liabilitiesincrease(decrease)inhomecurrency value whe
Bradford School of Business - BDS - 1066
Question # 05:Rate 9% Payments Principal portion Markup portion Balance principal -70000 70000 1 709.99 184.99 525 69815.0 2 709.99 186.4 523.6 69628.6 3 709.99 187.8 522.2 69440.9 4 709.99 189.2 520.8 69251.7 5 709.99 190.6 519.4 69061.1 6 709.99 192.0
Columbia - EE - 6010
Autoregulation: A Network MotifE6010: Lecture 2 Prof. Predrag R. Jelenkovi cDept. of Electrical Engineering Columbia University , NY 10027, USA predrag@ee.columbia.eduJelenkovi (Columbia University) cNetwork Motifs1 / 32Outline1Last Lecture Introd
UC Merced - ENG - 101
Nazario, Sonia. Enriques Journey: New York. Random House, 2006.In chapter three of Enriques Journey, by Sonia Nazario, Enriques eighth attempt to reach the United States is described. Enrique crosses the Rio Suchiate, which is the border between Guatemal
Grand Canyon - RELIGION - 255
The Life Of A Christian; a Very Narrow Road. And Jesus saith unto him, The foxes have holes, and the birds of the air have nests; but the Son of man hath not where to lay his head. Who went in the way before you, to search you out a place to pitch your te
UCLA - LING - 1
LINGUISTICS 1, WEB QUIZ #3 1. LISTEMES AND RULES 2. ARBITRARY RELATION BETWEEN FORM AND MEANING 3. NAMES FOR THINGS 4. BOUND ROOTS 5. DERIVATION AND INFLECTION I 6. DERIVATION AND INFLECTION II 7. WORD STRUCTURE TREES 8. USING WORD STRUCTURE TO MAKE JOKES