Notify Message
Forums
#4274290 Apr 26, 2011 at 02:41 AM · Edited 6 years ago
Member
184 Posts
I need help on this program so I can ace my final. I have everything except the calc button. Thanks.

Public Class frmHeartRates

Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtAge.Clear()
txtMHR.Clear()
txtName.Clear()
txtTarget1.Clear()
txtTarget2.Clear()
txtYearBorn.Clear()
End Sub

Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click


End Sub
End Class
Public Class HeartRates
Public name As String
Public byear As Double

Sub New(ByVal name1 As String, ByVal byear1 As Double)
name = name1
byear = byear1
End Sub
Public Function Age() As Double
Dim a As Double
a = 2011 - byear
Return a
End Function
Public Function MHR() As Double
Dim m As Double
m = 220 - Age()
Return m
End Function
Public Function TargetRange() As Double
Dim t1 As Double
t1 = 50 / 100 * MHR()
Return t1
End Function
Public Function TargetRange2() As Double
Dim t2 As Double
t2 = 85 / 100 * MHR()
Return t2
End Function

End Class
Never mind I figured it out. Thanks anyway.
Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
Hr = New HeartRates(txtName.Text, txtYearBorn.Text)
txtAge.Text = CStr(Hr.Age())
txtMHR.Text = CStr(Hr.MHR())
txtTarget1.Text = CStr(Hr.TargetRange())
txtTarget2.Text = CStr(Hr.TargetRange2())

+0 Quote
#4281453 Apr 27, 2011 at 10:47 AM
Member
34 Posts
You did not say what the purpose of the calc button was, or what fields are on the form.

Glad you worked it out.

By the way, why store birth year in double? Remember that double is approx., integers are more precise. Use double for decimal values only.

Lodestone Profile: Eld Deran
+0 Quote
#4302142 May 02, 2011 at 01:31 AM
Member
184 Posts
#4281453 Eld wrote:

You did not say what the purpose of the calc button was, or what fields are on the form.

Glad you worked it out.

By the way, why store birth year in double? Remember that double is approx., integers are more precise. Use double for decimal values only.

Most likely I was rushing and was worried about the final. We didn't have the final yet due to the tornado that hit us in Alabama. It'll be this week though.
+0 Quote
#4323352 May 06, 2011 at 02:43 AM
Member
184 Posts
I passed my final with a 80.
+0 Quote
#4325857 May 06, 2011 at 03:04 PM
Member
34 Posts
Congrats! Way to go! 8)

Lodestone Profile: Eld Deran
+0 Quote
#4326462 May 06, 2011 at 05:30 PM
Member
184 Posts
#4325857 Eld wrote:

Congrats! Way to go! 8)

Thanks. Is FFXIV back? The forum is dead.
+0 Quote
#4328557 May 07, 2011 at 06:49 AM
Member
34 Posts
The linkshell is very, very quiet, yes.

I actually like to solo and am enjoying FFXIV. Playing any time I can, mining, harvesting, fishing, synthing, etc.

I see Kyntyn online a lot, although she ignores all my tells so she may me afk! :P

Lodestone Profile: Eld Deran
+0 Quote
#4363764 May 14, 2011 at 05:29 PM
Member
56 Posts
People still use Visual Basic? o.O

Dear lord, tell your professors to teach you a real language.
+0 Quote
#4376877 May 17, 2011 at 02:59 PM
Member
184 Posts
#4363764 Vapes wrote:

People still use Visual Basic? o.O

Dear lord, tell your professors to teach you a real language.

So what language should I be studying?
+0 Quote
#4378332 May 17, 2011 at 08:35 PM
Leader
771 Posts
DOS or Java! =)



+0 Quote
#4378845 May 17, 2011 at 11:38 PM
Member
11 Posts
Python is the new Java - it's more intuitive to learn and plenty of power for most users. DOS is fine if you won't be leaving Windows, but I hear Perl is a must-learn scripting language. Good luck, and yeah Eld I leave my guy up for repairs quite often.
+0 Quote
#4380097 May 18, 2011 at 09:33 AM
Leader
771 Posts
That was supposed to be a joke Kyn. =P Anyways, I think I might be coming back once patch 1.18 hits if its got the battle adjustments and dungeons. How's the shell that your helping to run doing?



+0 Quote
#4381190 May 18, 2011 at 01:59 PM
Member
34 Posts
That's ok, Kyntyn, I finally got your attention! :) By the way, sorry for calling you a girl!

Regarding programming languages: It really depends on what you intend to develop. There are many languages out there.

If you are currently a Windows VB developer you can ease yourself into VB.Net or C# (using Mono on Linux).

Also, there are a lot of similarities between some languages. Once you know one it is relatively easy to learn another. For example: Java, C++ and C#

Note: The big difference is that the language is not enough these days. There are also API's to consider. They are the pre-programmed helpers for the different systems and vary a great deal. They help you pop messages on screen, develop window forms, edit boxes, grids, connect to databases, etc. For example: On Windows there is C# and VB.Net that requires the dotNet framework. On Mac OS X there is Cocoa that requires Objective-C. On Linux there is KDE or Gnome that work better with C++.

There are some frameworks (API's) that are more or less cross-platform: Qt (using C++), wxWidgets, and Mono (using C# and VB.Net) is a dotNet environment on Linux.

Some popular languages:

Windows Web: C# and/or VB.Net and ASP
Linux Web: Perl, PHP, Python, C# and/or VB.Net and ASP using Mono
Windows: C#, Java, Delphi, C or C++
Linux: Java, C and/or C++
Android: Java
Blackberry: Java
iPhone: C, Objective-C, C++
OS X: C, Objective-C, C++

As I said: What do you intend to develop?

Lodestone Profile: Eld Deran
+0 Quote
#4386862 May 19, 2011 at 05:52 PM
Member
184 Posts
Actually I don't know what I want to do in life. I'm thinking about networking for online gaming at the moment. I'm just trying to build up my resume so I can get a job. After I have some experience I can go after my dream job. I can't get pass this error in jGrasp about no main method or applet. Is this a jGrasp error or an error on my part?

public class Hello
{
static Scanner console = new Scanner(System.in);

public static void main(String[] args)
{
System.out.println("Hello World")
}
+0 Quote
#4540083 Jun 22, 2011 at 05:08 AM
Member
184 Posts
I'm assuming it's nothing wrong with this program then.
+0 Quote
#4620351 Jul 08, 2011 at 02:13 PM
Member
34 Posts
Sorry, I've never even heard of jGrasp...

You do not list the error, just the code. What is the error?

Lodestone Profile: Eld Deran
+0 Quote
#4637125 Jul 12, 2011 at 02:34 AM
Member
184 Posts
No main method or applet in the program. What software you use to create Java programs?
+0 Quote
#4851869 Aug 25, 2011 at 11:13 PM
Member
56 Posts
If you want to learn to do networking for online gaming, check out RakNet. As a Hobbyist you can get a free version of it. If you intend to be able to setup something like an MMO you're going to need to know the basics of HTTP protocols, a server side scripting language, like PHP, and MySQL for database stuff in addition to the Game Client/Game Server engines.

RakNet does a lot of that stuff for you. It's C++, which really if you're going to pick one ring to rule them all, C++ is probably your best bet, if you're not sure about specifics. In addition to all the other platforms mentioned almost all console (Xbox360,PS3,etc) development is C++, with the exception of XNA (for Xbox Live Arcade) which is C# (though if you're a developer and have a 360 dev license/kit you can just build for 360 in C++).

C# is a marketable skill just because not a lot of people are using it because it hasn't been adopted by a ton of things, but a lot of people are starting to port over to it on PC platforms, and it's arguably the "new hotness". Objective-C is useful if you want to work with some iOS stuff, but really if you learn C++ you can get by with a cursory understanding of Objective-C, since you can interchange the two in the same files, you just have to know the basics to use APIs written in objective-C (and most good APIs (which includes all of apple's stuff) have examples in their documentation, so you're golden. As an example, I don't know much about Objective-C but I wrote a wrapper (in C++) for the iOS GameKit (GameCenter stuff).

As for Java... it's on Android, I think you can wrap it in C++ too for the most part. Unity uses Java for their web stuff, but I you can do web stuff in C++ too I think using Chrome's Native Sandbox thing.
+0 Quote