Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write Visual Basic Programming Assignment # 1: (15 points): (Required: For this assignment, use pretest and posttest forms of the Do loop constructs.) Problem Statement
Write Visual Basic Programming
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. 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. Required: - NHI.. prk. A posttest toms or the Do loop constructs. Problem Statement Projectile Motion): Design and develop a Visual Basic application, or Projectile Motion to provide information on the height a ball throwa straight up into the air. As initial input, the program should request the initial height designated by loracicase letter in number of feet, and the initial velocity, designed by lowercase delle in number of feel pes ecuad. (Let weer lo initial Leight 210, sening will subscript zelv , melet lo initial velocity as vexti v wita subordat zco). When the application is loaded on Visual Scudo IDE, the total screen skoala Teemble, clown below: INT M . Ihrisyout at the form in the Designer window, consists of two label controls, cach associated with two textboxes, for the user to enter the Intial holght and Intial velocity at the time, the bellishowtiin ile cil, folowed by our button controls.euch essigned for a pericuelaku beplan, wale alive when plute Firelly, a listbox controlar lexulp! Input Validation: The Sexicului.rs wixbuses Cix Holy Spirit Highlil Initial Velochy, cmpty, or enter ad lepot. The input in these carboxcs mit be umer. prescrably of Decemal catatype. Sccp 1 ta textan case of invalid carry by the ECT you may then IN " Mixky, Hus les inuman win illale lidl mumeris ily. How it works Required: use a Sab-procedure "InputData() to check for vad entry by the taxer for the audtsal with an Tili Vily. This sul- pestenlille pil*:*] in your joying watel 1: cccceeble by ceber procedure to the code, when totaalucs by the user are requested The formula: The light fill de six given by the famous: IV 1.11 delli pilight - h - 18*LT Por cach of the following tasks, use an appropetate event handler. (a) Determine Maximum Height of the ball while in the air. Required: ucca Punction to compute tac maximum belght of the ball the trayectocy or thull while in the wir, which will resimleri downwards metec pattern, the maximam height att vertex Tec heights point toe al cocbc). The ball m-ill reach its maximam beight after v/32 seconde *Important. We cannot mcrcure the mam belght the ball reaches in negative sease. In XXXH YEAHS THCHI cal, and it in much WAY IS HINIH the maximum height of the ball bas . pocitie numeric magnitude in foct. (6) Determine Approximate Time until Bill Hits the Ground Note Thermawasiliti (necasm, when the light at the holl will be hra !!!) more. 1. Fust, at time sero 0 seconds before the ball is thrown into the air. 11. Second, at the time, the hell hit the wind, star molt parahnic pattem. Required: Use another Function to compute the height of the ball for every one-tenta (0.1) of a sorond, while the balls in the air. When the ball in the ground, Its height should ha zero(Coct. This will determine the approarimate time it) in seconde when the hall hits the ground, by using the formula: height t-vet 16. t.t to compute the height of the ball for every one-tenth (0.1) cia second. *Important!: The Internal computation of vanalliste compiler may not produce the dastrad praisot acuracy. Try to sparence with increments other than (0.1) seconds, for instance, you may wc incremcats of (0.01) (0.001) zcond. *Important: We annot marcate the approximate time, widen the ball hits the ground in negative sense. In such a case you are required to RAM your code and comment in such a way ASITA the approximate time of the hall to hit the roma's zer (0) (c) Display Table: This was the most u uw bal, Ling a labeul Required: Veea Sub-procedure to show the height of the ball for every quarter of second (029). Tot there the hall hits the ground at the height at A (reer ay xing a stay Control in display a table et vs les with two calm heading "Time", and "Height". *Important: Reemes when the ListBux displays Live Time of the ball luu every quarter of second assisted the Height", die weet hoe ball, Llewentylow in the ListBu slulu nol display the luciall of the bull with a negative value albime the ball hits the grammd. In his you are required to maxamina A, and construct it in arh way to ensure Lie height of the ball is zero (O) wen il lils llege. (d) Oult Exil the application by Lingering the "Quit Wullua Required: Best Practicesi For effective visual display, please use Courice Mont", for Currectly aligning the text in the list bux. 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! Step1: Oucu Lloe pulation vads, and stae following display pics the Forms and ils cuatrul Step2: Determine Maximum Height of the ball while in the sty: Arthantme, you will need to provide the initial night of the hall inte hit, and the initial velocity , in forter Sexmnd dem Lal llue initial reglul Olthe ball, ha a zero (0) Inel, and le milie velucily Ol' le ball, 0.236 feet/second, the following screen capture shou.d display the maximum be:ght of the ball while in the air Please note: The application should also provide possibilities for various entry values of total letght and selectey, in case the Tale Antries for those intol hatch and velocity values ara ritfferent. Step3: Determine Approximate Time until Ball Hits the Ground Acarme that the initial height of the ha11. h. is acro () fixt, and the initial velocity of the h:11, wf, is 36 fort/second, the following com capture should display the approximate time until the ball lit: the ground! Step 4: Display Table Assume that the initial height od the ball. Mu is zero (O) lees and the inital Velocity of the ball, v. 18 36 feet/second, the following screen capture sboud display the table of values, showing the helgat of the ball every quarter 10.25) se, until it hits the ground! ho Recommended naming convention For control objects appearing in the Code Editor Name Premerty Trst. Pranaity 1 Control Tyne Description frmBall Projectile Motion Form llolds application's controls txtinitialHeight Text Box Captures user's input for initial height ha txtinitialVelocity Text Box Captures user's input for initial velocity ve btn Maxl leight Delerine Maximum Height Button Triggers the event to compute maximum height btnApprox Time Deter. Af proximate Button Triggers the event to compute the approximate Til Fall Hits the count time the ball hit the ground btn'lable Display Table Button Triggers the event to display "Time" and "Height boutt Quit Button Triggers the event to exit the program Output Test Rex Columnar display of Time" and "Height" Remember that in acelitium of the above, you :12 TELA to pomoly suitable numming Convention to all variaoles that are declared and used (accessed in the application in the program code Projectile Motion - Projectile Motion Initial Height Initial Velocity: feet) feet/second) Initial Heighi feet) 0 Initial Velocity feet/vecond) 36 Determine Maximum Height Display Table Dulemine Maximum Height Display Table Determine Approximate Time until Ball Hits the Ground Quit Delemine Apprunale Time unilal Hts the Ground Qui 1stOutput The Fm height 13 y Projectile Motion y - Projectile Motion Initia Height 0 Initial Velocity fnet/scond) 36 Irtal Height:0 feet/second) Initial Velocity 36 feet) Display Determine Maximum Height Table Determine Maximum Height Display Tablo Determine Approximate Time until Ball His the Ground Out Determine Approximate Time untl Ball Hits the Ground QUE Height The ball w111 hit the ground after approximately 2.31 geaenda. Time 0.00 0.26 9.0 10.0 1.00 1.26 1.50 20.0 20. 19.0 14.0 2.00 0.0 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. 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. Required: - NHI.. prk. A posttest toms or the Do loop constructs. Problem Statement Projectile Motion): Design and develop a Visual Basic application, or Projectile Motion to provide information on the height a ball throwa straight up into the air. As initial input, the program should request the initial height designated by loracicase letter in number of feet, and the initial velocity, designed by lowercase delle in number of feel pes ecuad. (Let weer lo initial Leight 210, sening will subscript zelv , melet lo initial velocity as vexti v wita subordat zco). When the application is loaded on Visual Scudo IDE, the total screen skoala Teemble, clown below: INT M . Ihrisyout at the form in the Designer window, consists of two label controls, cach associated with two textboxes, for the user to enter the Intial holght and Intial velocity at the time, the bellishowtiin ile cil, folowed by our button controls.euch essigned for a pericuelaku beplan, wale alive when plute Firelly, a listbox controlar lexulp! Input Validation: The Sexicului.rs wixbuses Cix Holy Spirit Highlil Initial Velochy, cmpty, or enter ad lepot. The input in these carboxcs mit be umer. prescrably of Decemal catatype. Sccp 1 ta textan case of invalid carry by the ECT you may then IN " Mixky, Hus les inuman win illale lidl mumeris ily. How it works Required: use a Sab-procedure "InputData() to check for vad entry by the taxer for the audtsal with an Tili Vily. This sul- pestenlille pil*:*] in your joying watel 1: cccceeble by ceber procedure to the code, when totaalucs by the user are requested The formula: The light fill de six given by the famous: IV 1.11 delli pilight - h - 18*LT Por cach of the following tasks, use an appropetate event handler. (a) Determine Maximum Height of the ball while in the air. Required: ucca Punction to compute tac maximum belght of the ball the trayectocy or thull while in the wir, which will resimleri downwards metec pattern, the maximam height att vertex Tec heights point toe al cocbc). The ball m-ill reach its maximam beight after v/32 seconde *Important. We cannot mcrcure the mam belght the ball reaches in negative sease. In XXXH YEAHS THCHI cal, and it in much WAY IS HINIH the maximum height of the ball bas . pocitie numeric magnitude in foct. (6) Determine Approximate Time until Bill Hits the Ground Note Thermawasiliti (necasm, when the light at the holl will be hra !!!) more. 1. Fust, at time sero 0 seconds before the ball is thrown into the air. 11. Second, at the time, the hell hit the wind, star molt parahnic pattem. Required: Use another Function to compute the height of the ball for every one-tenta (0.1) of a sorond, while the balls in the air. When the ball in the ground, Its height should ha zero(Coct. This will determine the approarimate time it) in seconde when the hall hits the ground, by using the formula: height t-vet 16. t.t to compute the height of the ball for every one-tenth (0.1) cia second. *Important!: The Internal computation of vanalliste compiler may not produce the dastrad praisot acuracy. Try to sparence with increments other than (0.1) seconds, for instance, you may wc incremcats of (0.01) (0.001) zcond. *Important: We annot marcate the approximate time, widen the ball hits the ground in negative sense. In such a case you are required to RAM your code and comment in such a way ASITA the approximate time of the hall to hit the roma's zer (0) (c) Display Table: This was the most u uw bal, Ling a labeul Required: Veea Sub-procedure to show the height of the ball for every quarter of second (029). Tot there the hall hits the ground at the height at A (reer ay xing a stay Control in display a table et vs les with two calm heading "Time", and "Height". *Important: Reemes when the ListBux displays Live Time of the ball luu every quarter of second assisted the Height", die weet hoe ball, Llewentylow in the ListBu slulu nol display the luciall of the bull with a negative value albime the ball hits the grammd. In his you are required to maxamina A, and construct it in arh way to ensure Lie height of the ball is zero (O) wen il lils llege. (d) Oult Exil the application by Lingering the "Quit Wullua Required: Best Practicesi For effective visual display, please use Courice Mont", for Currectly aligning the text in the list bux. 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! Step1: Oucu Lloe pulation vads, and stae following display pics the Forms and ils cuatrul Step2: Determine Maximum Height of the ball while in the sty: Arthantme, you will need to provide the initial night of the hall inte hit, and the initial velocity , in forter Sexmnd dem Lal llue initial reglul Olthe ball, ha a zero (0) Inel, and le milie velucily Ol' le ball, 0.236 feet/second, the following screen capture shou.d display the maximum be:ght of the ball while in the air Please note: The application should also provide possibilities for various entry values of total letght and selectey, in case the Tale Antries for those intol hatch and velocity values ara ritfferent. Step3: Determine Approximate Time until Ball Hits the Ground Acarme that the initial height of the ha11. h. is acro () fixt, and the initial velocity of the h:11, wf, is 36 fort/second, the following com capture should display the approximate time until the ball lit: the ground! Step 4: Display Table Assume that the initial height od the ball. Mu is zero (O) lees and the inital Velocity of the ball, v. 18 36 feet/second, the following screen capture sboud display the table of values, showing the helgat of the ball every quarter 10.25) se, until it hits the ground! ho Recommended naming convention For control objects appearing in the Code Editor Name Premerty Trst. Pranaity 1 Control Tyne Description frmBall Projectile Motion Form llolds application's controls txtinitialHeight Text Box Captures user's input for initial height ha txtinitialVelocity Text Box Captures user's input for initial velocity ve btn Maxl leight Delerine Maximum Height Button Triggers the event to compute maximum height btnApprox Time Deter. Af proximate Button Triggers the event to compute the approximate Til Fall Hits the count time the ball hit the ground btn'lable Display Table Button Triggers the event to display "Time" and "Height boutt Quit Button Triggers the event to exit the program Output Test Rex Columnar display of Time" and "Height" Remember that in acelitium of the above, you :12 TELA to pomoly suitable numming Convention to all variaoles that are declared and used (accessed in the application in the program code Projectile Motion - Projectile Motion Initial Height Initial Velocity: feet) feet/second) Initial Heighi feet) 0 Initial Velocity feet/vecond) 36 Determine Maximum Height Display Table Dulemine Maximum Height Display Table Determine Approximate Time until Ball Hits the Ground Quit Delemine Apprunale Time unilal Hts the Ground Qui 1stOutput The Fm height 13 y Projectile Motion y - Projectile Motion Initia Height 0 Initial Velocity fnet/scond) 36 Irtal Height:0 feet/second) Initial Velocity 36 feet) Display Determine Maximum Height Table Determine Maximum Height Display Tablo Determine Approximate Time until Ball His the Ground Out Determine Approximate Time untl Ball Hits the Ground QUE Height The ball w111 hit the ground after approximately 2.31 geaenda. Time 0.00 0.26 9.0 10.0 1.00 1.26 1.50 20.0 20. 19.0 14.0 2.00 0.0Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started