Final Cheat Sheet

Final Cheat Sheet - Option Explicit Sub Mat r ix() Dim...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Option Explicit Sub Matrix() Dim Original(1 To 100, 1 To 100) As Single, Changed(1 To 100, 1 To 100) As Single, Big(1 To 100) As Single Dim i As Integer, j As Integer, R As Single, C As Single Open ("C: \Users \Cooper \Desktop \Large.txt") For Input As 1 Open ("C: \Users \Cooper \Desktop \LargeOut.txt") For Output As 2 Input #1, i, j For R = 1 To i For C = 1 To j Input #1, Original(R, C) Changed(R, C) = Original(R, C) Big(R) = Original(R, 1) Next C Next R For R = 1 To i For C = 1 To j If (Original(R, C) > Big(R)) Then Big(R) = Original(R, C) Next C Next R For R = 1 To i For C = 1 To i If (Changed(R, C) = Big(R)) Then Changed(R, C) = Changed(R, 1) Changed(R, 1) = Big(R) End If Next C Next R Print #2, "Original Array" For R = 1 To i For C = 1 To j Print #2, Original(R, C), Next C Print #2, Next R Print #2, Print #2, "Switched Array" For R = 1 To i For C = 1 To j Print #2, Changed(R, C), Next C Print #2, Next R Close End Sub Option Explicit Sub Add_Mat() Dim a(1 To 3, 1 To 3) As Double Dim b(1 To 3, 1 To 3) As Double Dim c(1 To 3, 1 To 3) As Double Dim i As Integer, j As Integer On Error GoTo Whoops 'In case you enter text Call Get_Values(a(), b()) For i = 1 To 3 For j = 1 To 3
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/18/2011 for the course ENGR 160 taught by Professor Sengupta during the Fall '07 term at Iowa State.

Page1 / 2

Final Cheat Sheet - Option Explicit Sub Mat r ix() Dim...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online