Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Whats wrong with this VBA? Sub problem2() Dim x0 As Integer, v0 As Integer, theta As Integer, g As Integer, t As Double, y0 As

Whats wrong with this VBA?

Sub problem2() Dim x0 As Integer, v0 As Integer, theta As Integer, g As Integer, t As Double, y0 As Integer Dim x As Double, y As Double Sheets("Sheet2").Select x0 = Range("F2").Value y0 = Range("F3").Value v0 = Range("F4").Value theta = Range("F5").Value g = -9.81 x = x0 + v0 * Cos(theta * (3.14159 / 180)) * t

y = y0 + v0 * Sin(theta * (3.14159 / 180)) * t + 0.5 * g * t ^ 2 Cells(2, 1) = 0 Cells(2, 2) = x Cells(2, 3) = y

Do While (y > 0) y = y0 + v0 * Sin(theta * (3.14159 / 180)) * t + (0.5 * g * t ^ 2) t = t + 0.1 ThisWorkbook.Worksheets("Sheet2").Range("A") = t ThisWorkbook.Worksheets("Sheet2").Range("C") = y

If y > 0 Then x = x0 + v0 * Cos(theta * (3.14159 / 180)) * t ThisWorkbook.Worksheets("Sheet2").Range("B") = x

End If

Loop

End Sub

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

What is oversampling?

Answered: 1 week ago

Question

Q.No.1 Explain Large scale map ? Q.No.2 Explain small scale map ?

Answered: 1 week ago

Question

1. Signs and symbols of the map Briefly by box ?

Answered: 1 week ago

Question

Types of physical Maps?

Answered: 1 week ago