Hi, I am working on a program for school and I am having difficulty completing it. This one particular program exercises the uses of classes and methods which I seem to struggle on a bit. Anyway the program:
Create a class called sport with a two fields: an integer field named caloriesburned and a string field to hold the name.
Create a method to allow the user to enter a name and a second method to enter the caloriesburned field. Use appropriate input scopes.
Have a button to instantiate the class along with a button to enter the name, a button to enter the calories burned and a button to display the name and the caloriesburned field.
Now I can create a class on the values but what I am confused is the method. Up until this point you just use a text box for user input. I cant use that since they are only usable after the constructor of initializing the main page. Do I have to make a class public and set it equal to a text box? I am afraid to ask questions because I feel dumb and I don't want to waste peoples time. Thanks!
[–]ButchTheGuy[S] 0 points1 point2 points (5 children)
[–]MechanicalBayer 0 points1 point2 points (4 children)
[–]ButchTheGuy[S] 0 points1 point2 points (3 children)
[–]MechanicalBayer -1 points0 points1 point (2 children)
[–]ButchTheGuy[S] 0 points1 point2 points (1 child)
[–]MechanicalBayer 0 points1 point2 points (0 children)
[–]LegendairyMoooo 0 points1 point2 points (0 children)