Skip to main content

Progress on the Pet Project

So, I don't have much, but I do have some. Behold my genius code for my hours calculation:

    Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click
        Dim s1 As Integer
        Dim s2 As Integer
        Dim s3 As Integer
        Dim s4 As Integer
        s1 = Val(txtTimeInSunday.Text)
        s2 = Val(txtTimeOutLunchSunday.Text)
        s3 = Val(txtTimeInLunchSunday.Text)
        s4 = Val(txtTimeOutSunday.Text)
        lblSundayHoursTotal.Text = s4 - s1 - (s3 - s2)

        Dim m1 As Integer
        Dim m2 As Integer
        Dim m3 As Integer
        Dim m4 As Integer
        s1 = Val(txtTimeInMonday.Text)
        s2 = Val(txtTimeOutLunchMonday.Text)
        s3 = Val(txtTimeInLunchMonday.Text)
        s4 = Val(txtTimeOutMonday.Text)
        lblMondayHoursTotal.Text = m4 - m1 - (m3 - m2)

        Dim t1 As Integer
        Dim t2 As Integer
        Dim t3 As Integer
        Dim t4 As Integer
        s1 = Val(txtTimeInTuesday.Text)
        s2 = Val(txtTimeOutLunchTuesday.Text)
        s3 = Val(txtTimeInLunchTuesday.Text)
        s4 = Val(txtTimeOutTuesday.Text)
        lblTuesdayHoursTotal.Text = t4 - t1 - (t3 - t2)

        Dim w1 As Integer
        Dim w2 As Integer
        Dim w3 As Integer
        Dim w4 As Integer
        s1 = Val(txtTimeInWednesday.Text)
        s2 = Val(txtTimeOutLunchWednesday.Text)
        s3 = Val(txtTimeInLunchWednesday.Text)
        s4 = Val(txtTimeOutWednesday.Text)
        lblWednesdayHoursTotal.Text = w4 - w1 - (w3 - w2)

        Dim th1 As Integer
        Dim th2 As Integer
        Dim th3 As Integer
        Dim th4 As Integer
        s1 = Val(txtTimeInThursday.Text)
        s2 = Val(txtTimeOutLunchThursday.Text)
        s3 = Val(txtTimeInLunchThursday.Text)
        s4 = Val(txtTimeOutThursday.Text)
        lblThursdayHoursTotal.Text = th4 - th1 - (th3 - th2)

        Dim f1 As Integer
        Dim f2 As Integer
        Dim f3 As Integer
        Dim f4 As Integer
        s1 = Val(txtTimeInFriday.Text)
        s2 = Val(txtTimeOutLunchFriday.Text)
        s3 = Val(txtTimeInLunchFriday.Text)
        s4 = Val(txtTimeOutFriday.Text)
        lblFridayHoursTotal.Text = f4 - f1 - (f3 - f2)

        Dim sa1 As Integer
        Dim sa2 As Integer
        Dim sa3 As Integer
        Dim sa4 As Integer
        s1 = Val(txtTimeInSaturday.Text)
        s2 = Val(txtTimeOutLunchSaturday.Text)
        s3 = Val(txtTimeInLunchSaturday.Text)
        s4 = Val(txtTimeOutSaturday.Text)
        lblSaturdayHoursTotal.Text = sa4 - sa1 - (sa3 - sa2)


    End Sub

It's very crude, probably, but it's somewhat working. It's not giving me any more data than Sunday's total hours. Not sure why. Going to ask or research some on that part.

But, check it out! Actual living, breathing program!


When you click the Calculate button, it's supposed to calculate the Daily Total and Actual Hours. Then, it compares those to the Scheduled Hours, and if you meet or exceed those hours, you'll get a big grinning happy picture or something like that on the right. If not, some sad face. It's progress! And it's exciting! :D

Now, I'm aware that there is very likely an infinitely much easier method of calculating the hours. For a first attempt, and to see the math and everything involved, though, I am very proud.

Comments

Popular posts from this blog

It's Alive!!!

My first program!!! It works! It installs! It does everything! :) Okay, I'm excited, but yesterday was a huge day. Not only did I pass my instructor test in my pilot school with a 97, but I also finished my first program. Functionality is completely perfect. The education I got from this was huge. Google answered nearly all of my questions, but I had to get quite a bit of help from my Supervisor to troubleshoot and help me piece it all together. Some things even baffled him for a second, which made me feel better. The code is pasted down below. Again, I'm sure there are better ways to do what I've done, but for my first program, I am thrilled to death! Public Class FRMTimeSheet     Private Sub Label1_Click(sender As Object, e As EventArgs) Handles lblMonday.Click     End Sub     Private Sub Label1_Click_1(sender As Object, e As EventArgs) Handles lblTimeIn.Click     End Sub     Private Sub Label1_Click_2(sender As Obj...

New Discoveries

So What Have We Learned Today, Class? Okay, I haven't progressed nearly as far as I had hoped in the textbook. Actually, I still haven't gotten past the GUI development in the 2nd chapter. This doesn't mean that I haven't been picking up what I can. Codefights has still been a great resource. Not knowing a lot of the functions has really been a hindrance. Not knowing many of the commonly known practices of developers has also slowed me down considerably. So, what have I learned? Visual Studio When I first started as a software tester in March this year, I was using TFS (Team Foundation Server) web portal. For those who don't know what this is, it's a web-based portal to let you see what your team is working on. Above is a generic screenshot of what's going on right now and things we're fixing. You can click on each task and see more specific details. This view is much easier to navigate to me, but I needed to learn how to integrate with Vi...

Developer Update

I felt it was time to update what I've done in development lately. Sadly, it's not as much as I had hoped. My current plans are to enroll in Western Governor's University and continue my programmer education there, as well as these pet projects on the side. The requirements for enrollment are a little strict, though. I have to have either an Associate's degree already in the area of study or better, or I have to have 3 years experience in that field. I have six months in the area right now, but I worked as a tech liason for about 10 years in my customer service position. I'm hoping that will help. Here's the unusual part at the moment: I cannot reach the enrollment counselor. We've spoke, been introduced, he was going to read my resume over and discuss options, and we were supposed to get back together on the phone that Friday (two weeks ago). I missed the call due to a meeting at work, but called back an hour later. I've left three voice mails since. I...