Lecture 11 - Review for Exam 1 VBA

Lecture 11 - Review for Exam 1 VBA - Do y = m * x + b...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Module1 - 1 Option Explicit Sub test_1_review() Dim name As String, m As Single, b As Single, x As Single, y As Single, x_start As Single Dim x_stop As Single, delta_x '**************Review Test 1***************************** 'name is the name of the person using the program 'm is the slope of a line 'b is the y-intercept of a line '******************************************************** MsgBox ("This program will help you review for the first exam") m = InputBox("What is the slope of the line?") MsgBox ("The slope of the line you entered is: b = InputBox("What is the y-intercept of the line?") MsgBox ("The y-intercept of the line you entered is: x = InputBox("Where would you like to start x?")
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Do y = m * x + b MsgBox ("y = " & y & " lbs. when x = " & x & " inches") x = x + 0.5 If (x > 10) Then Exit Do Loop '********************************************* ' x_start is where the value of x will start ' x_stop is where the value of x will stop ' delta_x is the step size for x--how much x will increase '************************************************ x_start = InputBox("Where would you like to start x?") x_stop = InputBox("Where would you like to stop x?") delta_x = InputBox("How big do you want the steps of x to be?") For x = x_start To x_stop Step delta_x y = m * x + b MsgBox ("y = " & y & " lbs. when x = " & x & " inches") Next x End Sub...
View Full Document

Ask a homework question - tutors are online