Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

With Visual Basic Program Please Assignment # 1: (15 points): (Required: For this assignment, use pretest and posttest forms of the Do loop constructs.) Problem

With Visual Basic Program Pleaseimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Assignment # 1: (15 points): (Required: For this assignment, use pretest and posttest forms of the Do loop constructs.) Problem Statement (Projectile Motion): Design and develop a Visual Basic application, for Projectile Motion to provide information on the height of a ball thrown straight up into the air. As initial input, the program should request the initial height, designated by lowercase letter h , in number of feet, and the initial velocity, designated by lowercase letter V, in number of feet per second. (let us refer to initial height as ho, meaning h with subscript zero and, and refer to initial velocity as vo, meaning v with subscript zero). When the application is loaded on Visual Studio IDE, the initial screen should resemble, as shown below: Projectile Motion Initial Haight Intial Velocity feet/second) Display Table Determine Mad.mn Hegit Determine Approximate Time unti Bol Hits the Ground 1 Output Thelayout of the Form in the Designer window, consists of two label controls, each associated with two textboxes, for the user to enter the intial height, and intial velocity at the time, the ball is thrown in the air, folowed by four button controls, eaach assigned for a particuar task to be performed, as shown on the above screen capture. Finally, a listbox control for the output! Input Validation: The user should not leave the textboxes for the entry of the Initial Height and Initial Velocity, empty, or enter invalid input. The input in these textboxes must be numeric (preferably of Decimal data type. See pp 60-1 in text). In case of invalid entry by the user you may then use a "Message Dialog Box to inform and warn the user to enter valid numeric entry. How it works! Required: Use a Sub-procedure InputData()"to check for valid entry by the user for the Initial Height and Initial Velocity. This sub-procedure should be placed in your programming code and be accessible by other procedures in the code, when initial values by the user are requested. The formula: The height of the ball (in feet) after t seconds is given by the formula: h +vt-167?. It should be coded in the program as: height = h + VO * t - 16 * t*t For each of the following tasks, use an appropriate event handler. (a) Determine Maximum Height of the ball while in the air: Required: Use a Function to compute the maximum height of the ball-The trajectory or the movement of the ball while in the air, which will resemble a parabolic curve that opens downward as an inverted U pattern, like 'n with the maximum height at its vertex (The heights point the ball reaches). The ball will reach its maximum height after vo/32 seconds. *Important*: We cannot measure the maximum height the ball reaches in negative sense. In such a case you are required to reexamine your code, and construct it in such a way to ensure the maximum height of the ball has a positive numeric magnitude in feet. Determine Approximate Time until Ball Hits the Ground: Note: There are two possibilities (occasions), when the height of the ball will be zero (O) foot. i. First, at time zero (0 second), before the ball is thrown into the air. ii. Second, at the time, the ball hits the ground, after following its parabolic pattern. Required: Use another Function to compute the height of the ball for every one-tenth (0.1) of a second, while the ball is in the air. When the ball hits the ground, its height should be zero (O) foot. This will determine the approximate time (t) in seconds, when the ball hits the ground, by using the formula: height = he + vo * t - 16 * t*t to compute the height of the ball for every one-tenth (0.1) of a second. *Important*: The internal computation of Visual Basic Compiler may not produce the desired precision of accuracy. Try to experience with using increments other than (0.1) seconds, for instance, you may use increments of (0.01) or (0.001) second. *Important*: We cannot measure the approximate time, when the ball hits the ground in negative sense. In such a case you are required to reexamine your code, and construct it in such a way to ensure the approximate time of the ball to hit the ground is zero (0). Display Table: This task measures the movement of the ball, using a table of values. Required: Use a Sub-procedure to show the height of the ball for every quarter of second (0.25), until the time the ball hits the ground at the height of zero (O) feet by using a ListBox Control to display a table of values with two column headings Time", and "Height. *Important*: Remember when the ListBox displays the "Time of the ball for every quarter of second, associated the "Height, or the movement of the ball, the last entry row) in the ListBox should not display the height of the ball with a negative value at the time the ball hits the ground. In such a case you are required to reexamine your code, and construct it in such a way to ensure the height of the ball is zero (O), when it hits the ground. (d) Quit: Exit the application by triggering the Quit "button Required: (Best Practices) For effective visual display, please use "Courier New font", for correctly aligning the text in the list box. This will provide clarity and readability. Additionally, make sure that you will clear all the entries that are currently are displayed in the ListBox. Running the application! Step 1: Once the application loads, and runs, the following display depicts the Form and its controls. Projecte Motion Mecht Determine Rome Te Less Step2: Determine Maximum Height of the ball while in the air: At the runtime, you will need to provide the initial height of the ball in feet ho, and the initial velocity vo, in feet per second Assume that the initial height of the ball, ho, is zero (0) feet, and the initial velocity of the ball, vo, is 36 feet/second, the following screen capture should display the maximum height of the ball while in the air ! Mowa Hey wel Be God The M L Please note: The application should also provide possibilities for various entry values of initial height and velocity, in case the user entries for these initial height and velocity values are different. Step3: Determine Approximate Time until Ball Hits the Ground: Assume that the initial height of the ball, ho, is zero (O) feet, and the initial velocity of the ball, vo, is 36 feet/second, the following screen capture should display the approximate time until the ball hits the ground! Projectile Montes Wooly Taille M Halt werin AYAT w Bal Hitat Sound The ball wil has the ground Step4: Display Table: Assume that the initial height of the ball, ho, is zero (0) feet, and the initial velocity of the ball, vo, is 36 feet/second, the following screen capture should display the table of values, showing the height of the ball every quarter (0.25) second, until it hits the ground! Proiecte Motion Wil Woo U fet/econd Duly Table LATINA Her Hugint De Adun Time ut Bal Hate Gund TaighE 0.00 14.0 10.0 0.50 0.95 100 1.25 1.50 1.96 2.00 10.0 Recommended naming convention: For control objects appearing in the Code Editor. Name Property Text Property Control Type Description frmBall Projectile Motion Form Holds application's controls txtInitialHeight Text Box Captures user's input for initial height ho txtInitialVelocity Text Box Captures user's input for initial velocity vo btnMaxHeight Determine Maximum Height Button Triggers the event to compute maximum height btnApproxTime Determine Approximate Button Triggers the event to compute the approximate Time until Ball Hits the Ground time the ball hits the ground btnTable Display Table Button Triggers the event to display "Time", and "Height" btnQuit Quit Button Triggers the event to exit the program IstOutput List Box Columnar display of "Time", and "Height" Remember that in addition of the above, you are required to apply suitable naming convention to all variables that are declared and used (accessed in the application) in the program code. Assignment # 1: (15 points): (Required: For this assignment, use pretest and posttest forms of the Do loop constructs.) Problem Statement (Projectile Motion): Design and develop a Visual Basic application, for Projectile Motion to provide information on the height of a ball thrown straight up into the air. As initial input, the program should request the initial height, designated by lowercase letter h , in number of feet, and the initial velocity, designated by lowercase letter V, in number of feet per second. (let us refer to initial height as ho, meaning h with subscript zero and, and refer to initial velocity as vo, meaning v with subscript zero). When the application is loaded on Visual Studio IDE, the initial screen should resemble, as shown below: Projectile Motion Initial Haight Intial Velocity feet/second) Display Table Determine Mad.mn Hegit Determine Approximate Time unti Bol Hits the Ground 1 Output Thelayout of the Form in the Designer window, consists of two label controls, each associated with two textboxes, for the user to enter the intial height, and intial velocity at the time, the ball is thrown in the air, folowed by four button controls, eaach assigned for a particuar task to be performed, as shown on the above screen capture. Finally, a listbox control for the output! Input Validation: The user should not leave the textboxes for the entry of the Initial Height and Initial Velocity, empty, or enter invalid input. The input in these textboxes must be numeric (preferably of Decimal data type. See pp 60-1 in text). In case of invalid entry by the user you may then use a "Message Dialog Box to inform and warn the user to enter valid numeric entry. How it works! Required: Use a Sub-procedure InputData()"to check for valid entry by the user for the Initial Height and Initial Velocity. This sub-procedure should be placed in your programming code and be accessible by other procedures in the code, when initial values by the user are requested. The formula: The height of the ball (in feet) after t seconds is given by the formula: h +vt-167?. It should be coded in the program as: height = h + VO * t - 16 * t*t For each of the following tasks, use an appropriate event handler. (a) Determine Maximum Height of the ball while in the air: Required: Use a Function to compute the maximum height of the ball-The trajectory or the movement of the ball while in the air, which will resemble a parabolic curve that opens downward as an inverted U pattern, like 'n with the maximum height at its vertex (The heights point the ball reaches). The ball will reach its maximum height after vo/32 seconds. *Important*: We cannot measure the maximum height the ball reaches in negative sense. In such a case you are required to reexamine your code, and construct it in such a way to ensure the maximum height of the ball has a positive numeric magnitude in feet. Determine Approximate Time until Ball Hits the Ground: Note: There are two possibilities (occasions), when the height of the ball will be zero (O) foot. i. First, at time zero (0 second), before the ball is thrown into the air. ii. Second, at the time, the ball hits the ground, after following its parabolic pattern. Required: Use another Function to compute the height of the ball for every one-tenth (0.1) of a second, while the ball is in the air. When the ball hits the ground, its height should be zero (O) foot. This will determine the approximate time (t) in seconds, when the ball hits the ground, by using the formula: height = he + vo * t - 16 * t*t to compute the height of the ball for every one-tenth (0.1) of a second. *Important*: The internal computation of Visual Basic Compiler may not produce the desired precision of accuracy. Try to experience with using increments other than (0.1) seconds, for instance, you may use increments of (0.01) or (0.001) second. *Important*: We cannot measure the approximate time, when the ball hits the ground in negative sense. In such a case you are required to reexamine your code, and construct it in such a way to ensure the approximate time of the ball to hit the ground is zero (0). Display Table: This task measures the movement of the ball, using a table of values. Required: Use a Sub-procedure to show the height of the ball for every quarter of second (0.25), until the time the ball hits the ground at the height of zero (O) feet by using a ListBox Control to display a table of values with two column headings Time", and "Height. *Important*: Remember when the ListBox displays the "Time of the ball for every quarter of second, associated the "Height, or the movement of the ball, the last entry row) in the ListBox should not display the height of the ball with a negative value at the time the ball hits the ground. In such a case you are required to reexamine your code, and construct it in such a way to ensure the height of the ball is zero (O), when it hits the ground. (d) Quit: Exit the application by triggering the Quit "button Required: (Best Practices) For effective visual display, please use "Courier New font", for correctly aligning the text in the list box. This will provide clarity and readability. Additionally, make sure that you will clear all the entries that are currently are displayed in the ListBox. Running the application! Step 1: Once the application loads, and runs, the following display depicts the Form and its controls. Projecte Motion Mecht Determine Rome Te Less Step2: Determine Maximum Height of the ball while in the air: At the runtime, you will need to provide the initial height of the ball in feet ho, and the initial velocity vo, in feet per second Assume that the initial height of the ball, ho, is zero (0) feet, and the initial velocity of the ball, vo, is 36 feet/second, the following screen capture should display the maximum height of the ball while in the air ! Mowa Hey wel Be God The M L Please note: The application should also provide possibilities for various entry values of initial height and velocity, in case the user entries for these initial height and velocity values are different. Step3: Determine Approximate Time until Ball Hits the Ground: Assume that the initial height of the ball, ho, is zero (O) feet, and the initial velocity of the ball, vo, is 36 feet/second, the following screen capture should display the approximate time until the ball hits the ground! Projectile Montes Wooly Taille M Halt werin AYAT w Bal Hitat Sound The ball wil has the ground Step4: Display Table: Assume that the initial height of the ball, ho, is zero (0) feet, and the initial velocity of the ball, vo, is 36 feet/second, the following screen capture should display the table of values, showing the height of the ball every quarter (0.25) second, until it hits the ground! Proiecte Motion Wil Woo U fet/econd Duly Table LATINA Her Hugint De Adun Time ut Bal Hate Gund TaighE 0.00 14.0 10.0 0.50 0.95 100 1.25 1.50 1.96 2.00 10.0 Recommended naming convention: For control objects appearing in the Code Editor. Name Property Text Property Control Type Description frmBall Projectile Motion Form Holds application's controls txtInitialHeight Text Box Captures user's input for initial height ho txtInitialVelocity Text Box Captures user's input for initial velocity vo btnMaxHeight Determine Maximum Height Button Triggers the event to compute maximum height btnApproxTime Determine Approximate Button Triggers the event to compute the approximate Time until Ball Hits the Ground time the ball hits the ground btnTable Display Table Button Triggers the event to display "Time", and "Height" btnQuit Quit Button Triggers the event to exit the program IstOutput List Box Columnar display of "Time", and "Height" Remember that in addition of the above, you are required to apply suitable naming convention to all variables that are declared and used (accessed in the application) in the program code

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

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 2 Lncs 8056

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013th Edition

3642401724, 978-3642401725

More Books

Students also viewed these Databases questions

Question

When will I do them?

Answered: 1 week ago

Question

files with an extension . java contain java bytecode

Answered: 1 week ago