Replacement Plan Program

Jack Parsons

New member
Joined
Nov 7, 2008
Messages
1
Programming Experience
Beginner
Let me start of with an explanation of what I am trying to do. I work for the Air Force in Texas in a radio maintenance shop. I learned some basic VB several years back and am now presented with an opportunity to create a program for our replacement plans we have with our radio equipment. I am having trouble just getting started, so I guess I need a kick start or something.


Note: The form is attached.



There is a simple formula to this. We keep track of how old the equipment is and how many maintanence actions have been performed on the equipment. So, for the age of the equipment in years we multiply that by 2. We multiply the amount of maintanence actions by 3. If the equipment has been phased out we add 15. We add the results and apply to our points system below.

So breaking it down:

2 points per year of age
3 points per repair action
15 points per year for phased out equipment

If the value is

0 - 45 Doesn't need to be replaced
46-50 Needs to be replaced in 5 years (Current date + 5)
51-55 Needs to be replaced in 4 years (Current date +4)
56-60 Current date + 3
61-65 Current date + 2
66-75 Current date + 1
76 + Current date


With that, I am trying to take the users input from "Age (In Years)", "Prev Maint Actions", and "Year Phased Out (if applicable)" and display the replacement date in the "Replacement Date" text box.

I would also pay someone if they would be interested in writing this (I don't know if this is against forum rules, if it is I will delete this statement.)

I can't even begin getting the forumlas to work correctly I am just presented with tons of errors. Thanks for any help!

the text boxes are named

AgeTextBox
MaintTextBox
PhasedTextBox
DateTextBox

the buttons are named

GenerateButton
NewButton
ExitButton
 

Attachments

  • untitled.JPG
    untitled.JPG
    9.4 KB · Views: 37
See if the attached is close to what you need.

I put some value in the app.config file, which would allow you easily change the multipliers. You could also do something similar with your point ranges.

Things to note:

1. Your screenshot had a Years Phased Out field, but your message indicated Year Phased Out. If it needs to be year, then you will need to change to program to handle that.

2. There isn't any error handling in the application, so invalid values in the fields will cause an error. I'll leave it up to you to fix this.

Cavar
 

Attachments

  • Sandbox.zip
    14.9 KB · Views: 17
For multiple case and range selection using a Select-Case structure is far easier to type and more readable:
VB.NET:
Select Case points
    Case 0 To 45

    Case 46 To 50

End Select
Cavar, did you try to make this simple code look as difficult as possible? ;)
Jack Parsons said:
I would also pay someone if they would be interested in writing this (I don't know if this is against forum rules, if it is I will delete this statement.)
I was really tempted to put your whole post in a Quote box, because it looks like taken right out of a book exercise from first chapter in "Starting VB.Net". We have a "Hiring" forum where you can ask to hire poeple to do programming jobs for you, there exists also sites dedicated to such as "Rent A Coder" and can easily be used by rich school kids that would rather pay someone to do their homework. Now you have received a complete free solution, but if you have any ambition of learning even the basics of VB.Net you should start reading that book, give it a try, and ask about things you find difficult, and not for someone to "solve it" for you. If not you'd rather visit the places I mentioned instead of these user forums.
 
For multiple case and range selection using a Select-Case structure is far easier to type and more readable:
VB.NET:
Select Case points
    Case 0 To 45

    Case 46 To 50

End Select
Cavar, did you try to make this simple code look as difficult as possible? ;)

You know, I started to do a Select Case similar to that, but I couldn't remember the format and was trying Case 0 - 45, which obviously won't work becase 0 - 45 is -45. Besides, F1 is too work to press since I am super lazy. ;)

Plus I've been doing C# for so long now and have become accustomed to the switch statement.

Thanks for reminding me.

Cavar
 
Back
Top