Monday, March 19, 2012
Name Search and Tic Tac Toe
After about a week of trying to get these programs to work. I have deleted them and decided to start from scratch again. These are really frustrating problems. Some reason I can't quite figure out how to get the text files to open, I keep getting errors such as unable to open when using StreamReader. The tic tac toe simulation is another major headache. I can't get them into two arrays to display the X's and O's. Maybe tomorrow with a fresh start I can begin to make headway on these two assignments.
Thursday, March 8, 2012
Chapter 7 arrays
This would normally be one of my least favorite areas, before programming. Before programming the thing that popped into my head when arrays were mentioned were matrices that I had a tough time within Calculus. Now arrays are a simpler way to do things instead of having to enter in variables one at a time, they can be placed in an array for reference later. I do appreciate the Sequential Search Slide, as a more visual person it does help to see code before being able to use it. I have a feeling that it will come in handy with the two assignments, but I will attempt them over the weekend since it is an extended week due to Spring Break. Have fun and stay safe all.
Sunday, February 26, 2012
Midterm Project Done
This was fun, I think the hardest part for me was figuring out what I want to put as a method. As I am a fairly lazy person, if it is a program that I make solo; normally I just do everything in the button clicks when possible and hardly use methods. Although when working with others, I do appreciate methods since it can be easier to piece everything together and troubleshoot. Good luck everyone, if there's any trouble I'd be more than happy to point towards the right direction.
Friday, February 24, 2012
Rock, Paper, Scissors?
So far I have only made the picture boxes and forms for the midterm project, I will probably try to wrap it up by this Sunday to play with it for a week before turn in. Looking forward to making the stuff behind the picturebox work.
Saturday, February 18, 2012
Methods a new tool to be lazy
Finished both problems, I made a HUGE error initially when I did the Joe's Automotive. I forgot that whitespace is a big no no when it comes to naming, it also applies to file names. Methods will likely be a huge help in trouble shooting so that if a logic error occurs, the method just needs to be isolated than the entire predefined method. Calling methods also makes the click action a lot more cleaner looking than a mess that mine usually resembles. If your having trouble with some of the method code, Below is a sample of what I used for Joe's Automotive problem, just remember before you start don't use the apostraphe in the save name or hours of work will go wasted.
private int OilLubeCharges()
{
int total = 0;
if (oilChangeCheckBox.Checked)
{
total += 26;
}
if (lubeJobCheckBox.Checked)
{
total += 18;
return total;
}
else
{
return total;
}
}
Good luck with programming, I found the hospital one to be the easy victory. The Automotive one is a bit of a task but if you have used methods before its a lot of the same as modules in pseudocode.
Wednesday, February 15, 2012
Chapter 6 More Methods to Mayhem
I knew that this chapter was going to be a good one, after the first page mentioning "Divide and Conquer." Whether it is in programming or networking, that approach tends to work well. In Networking the OSI model is a loosely based Divide and Conquer approach. Working from the simple to the more complex routes to a solution is my favorite way since, if it does happen to just need a simple fix then the problem is resolved before trying complex methods.
Overall, I am glad that the book is introducing these new concepts at a moderate pace. I enjoy working smarter not harder quite a bit. Now with this chapter, I can leave message boxes that can be as annoying as the User Account Control feature that comes standard with Windows Vista. "Are you sure?"....."Are You Really Sure?"....."Are You Really Really Sure." Well now the mayhem will ensue tomorrow as I attempt the Joe's Automotive problem.
Overall, I am glad that the book is introducing these new concepts at a moderate pace. I enjoy working smarter not harder quite a bit. Now with this chapter, I can leave message boxes that can be as annoying as the User Account Control feature that comes standard with Windows Vista. "Are you sure?"....."Are You Really Sure?"....."Are You Really Really Sure." Well now the mayhem will ensue tomorrow as I attempt the Joe's Automotive problem.
Sunday, February 12, 2012
Chapter 5 wrap up
Chapter 5 was a lot easier to digest than chapter 4. The one thing that I will have to get used to is declaring private variables in the form instead of local variables in the buttons. The assignments this time around were about half the code that the workshop selector was. So far having lots of fun with using Visual Studio. Also learned a new way to create a pop up box, its useful for the Random Number Guessing program.
else if (yourNumber == randomNumber)
{
if (MessageBox.Show("Congratulations, You won. Would you like to play again?", "You win!", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
// enter your code to restart the random event again here
}
else
{
this.Close();
}
}
Subscribe to:
Posts (Atom)