lab5 - Lab 5: Subroutine and Functions Lab Problem-1 (HW...

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

View Full Document Right Arrow Icon
1 Lab 5: Subroutine and Functions Lab Problem-1 (HW -1): Working with subroutines Objectives: Design a VB program to compute an integral of a function using the trapezoidal rule and using a subroutine. Three circular subdivisions need to be cleared for construction. The XYZ tree cutting company charges $100 per square feet to clear trees and to stabilize the area, and would charge $5 per linear ft to install fence in that area. Approximate radii of the sites are estimated to be 50, 75, and 100 ft. The program below does most of the work for you, but you need modify it slightly to evaluate the costs. No of plots 3 Radius of the plots 50 75 100 Total area 56964.28125 Total fence length 1414.285645 Total clearing cost ?? Fencing cost ??? Private Sub CommandButton1_Click() Dim n As Integer Dim r1 As Single, a1 As Single, p1 As Single Dim r2 As Single, a2 As Single, p2 As Single, total_area As Single Dim r3 As Single, a3 As Single, p3 As Single, total_perimeter As Single n = Cells(1, 2) r1 = Cells(2, 2) r2 = Cells(2, 3) r3 = Cells(2, 4) Call mycircle(r1, a1, p1) Call mycircle(r2, a2, p2) Call mycircle(r3, a3, p3) total_area = a1 + a2 + a3 total_perimeter = p1 + p2 + p3
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 11/14/2011 for the course CE 3010 taught by Professor Clement during the Fall '09 term at Auburn University.

Page1 / 2

lab5 - Lab 5: Subroutine and Functions Lab Problem-1 (HW...

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