Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,150,843 members, 7,810,248 topics. Date: Saturday, 27 April 2024 at 02:23 AM |
Nairaland Forum / Science/Technology / Programming / Help Me Cross Check My Visual Basic Code (1217 Views)
All You Need To Know About Visual Basic / Is Learning Visual Basic Under Asp.net In 2017, A Waste / Check My App Pin Pals Out (2) (3) (4)
Help Me Cross Check My Visual Basic Code by Thirdwrist(m): 11:33am On Apr 22, 2016 |
I was asked to do an assignment for someone on Visual basic, I programme only in PHP and Javascript but I thought to myself that it would'nt be hard to learn the syntax of VB, albeit the project was a simply one and knowledge in the previous languages will come in handy. I was asked to build a programme to find the mean of 5 numbers And a programme to calculate the volume of a cylinder. I cant compile this code on visual studio because i dont have that amount of data to download 6gb compiler, so please just help me cross check.
Volume of a cylinder
|
Re: Help Me Cross Check My Visual Basic Code by megablinks(m): 1:19pm On Apr 22, 2016 |
Firstly ur variable declarations are somewhat not too good. What if u r given 5 decimal numbers to look for their mean and ur result is returning integer. Same goes for the volume, where height and others can also take on decimal values. And for the vb compiler, u can get it at any software store for #200 or so. Walking with visual studio makes life easier. Hoping to hear from u soon. |
Re: Help Me Cross Check My Visual Basic Code by cuvox(m): 9:14pm On Apr 22, 2016 |
using text boxes private sub add_click dim. sum=0, num=0, num2=0, num3=0, num4=.0, num5=0, mean=0 as double num1=val(Textbox1.Text) num2=val(Textbox2..Text) etc down to textbox 5 sum= num1 +. num2 etc/5 lblanswer.Text=sum end sub |
Re: Help Me Cross Check My Visual Basic Code by cuvox(m): 9:36pm On Apr 22, 2016 |
private sub calculate...click dim num=0, sum=0, mean=0, counter=0 as double do num=inputbox.show ("please enter number ") sum=sum+number while counter<5 counter+ end do mean=sum/5 messagebox.show(Null, "mean is" + mean ) end sub |
(1) (Reply)
Pyqt4 / Programmers Needed / Nairaland Is Anti-ponzi Scheme, Moderator But Why Are You Allowing Ponzi Here?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 17 |