Saturday, May 5, 2012
Final and Project COMPLETE
This last project really did challenge me, I had to take a few varied approaches to this problem. The tutorial on page 507 really helped me out as none of the other assignments involved reading a delimited text file. The tutorial is also fairly similar except you want to populate a list box then display all pertinent information. Good Luck all. If any troubles I can sort of help after work in a few hours.
Sunday, April 29, 2012
A bit puzzled
Ok I got my program to get the end result the same as the text file. However, I think I might have done something wrong since I didn't use a class unless the 2nd form counts as a class. I think mostly its cause I use 95 lines of code total in the MainForm to finish a final project which seems a bit low for me. Part of me wants to turn this in and get studying for the final the other part thinks something is wrong having too few lines and possibly excluding a class from the answer. Maybe I am just not quite understanding what exactly a class is and have the correct solution. Regardless, I am going to take a break from programming for today to start studying for other classes. Later in the week I may revisit the code but for now I am partially content that it does display the name, email, and phone number.
Sunday, April 22, 2012
Chapter 9 Homework done!
Finished with Chapter 9, the dorm and meal calculator was the tougher of the two not due to the coding but other reasons. I knew the code was working but had trouble changing the label in the second form til I realized that it needed to have its modifier set to public. After that it was smooth sailing. I looked over the Final Project, I think it will be a challenge combining many different aspects from former chapters. I will try to get an early start on it so that other finals can get the attention they deserve. Good luck everyone.
Saturday, April 14, 2012
Chapter 9 Classes and Multiform Projects
Now that its nearing the end and most basic skills have been acquired. I look forward to the challenges that come ahead. Chapter 9 kind of reviewed the basics of the class being the "blueprint" of the code. The hesitation I will prolly have is getting used to using multiform objects and keeping them clutter free. The dorm and car class problems will have to wait till monday as I am finishing up other projects but I do look forward to the new challenge. The Slot Machine was my favorite assignment in any programming class.
Saturday, April 7, 2012
One down, tough one to go
After doing some more array practice from the book, I was able to finish the Drink Machine fairly quick and this time the code doesn't look massive. I probably should have done more than just set up the front face for the problems as now it seems the code seems to be a bit tougher to grasp. I am starting to like the arrays although still do not quite feel comfortable with using them. The arrays do save time and I hope to finish the Slot Machine problem sometime later tonight or after work tomorrow.
Sunday, April 1, 2012
Drink and Slot Machines
Arrays are still something I do not quite like but will have to eventually get them to work. So far the layout for both has been setup but that is the easy part, the tough part is going to be getting the arrays to work with the given questions. The random number part will be easy, the lottery practice solution helped out a lot with grasping some of the array storage of random numbers. This week should be a challenge.
Wednesday, March 21, 2012
Clear thoughts and finished programs
After starting over from scratch I decided to give the two programs another attempt. I did find a flaw with the tic tac toe simulator. If it is all random numbers then there is a chance that X or O can move in a disproportionate amount of times in respects to each other. By default there are 8 possible ways to win for either X or O. However, in the program both could possibly win with two horizontal wins or two vertical wins. Also the program will pick X as the winner in the event that there are two winners. Although the name search just took some getting used to utilizing the Binary Search method, I found the tic tac toe simulator to be a challenge that was fun. I look forward to the coming weeks and increasing my knowledge on C# programming. Good luck everyone.
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(); } }
Wednesday, February 8, 2012
Chapter 5 Listboxes, Loops, and Storage
This chapter is where I am starting to get a hang of Visual Studio. Listboxes were fun last chapter but now loops are introduced, I remember making simple loops on friend's TI-84 calculators. They didn't do anything other than repeat endlessly since the code was.
label A disp "Your calculator is broken" Goto AThat would be a minor prank I would play on friend's when they weren't near their calculator, it would basically endlessly loop. Now I get to learn how to make use of loops other than for pranking purposes. Some of the data storage methods reminded me of the Linux Vi which I hated using since graphical interfaces are common on almost all distributions. I remember having to | to append things to files and the > to create new files. Although a lot has escaped me, some of this chapter brought back some memories of using the Vi editor. After finishing Chapter 5 and the Dice Simulator, I now appreciate the ease of Visual Studio. Instead of having to type everything through notepad and run it to see if it works, the errors at the bottom make it easier to find where to correct the mistake.
Friday, February 3, 2012
Chapter 4 troubles
The color selection program went smoothly, now working on the workshop selector which is giving some problems. I know there has got to be an easier way than turning this thing into a Rude Goldberg Machine. Here is a sample of the code I have so far
private void btn_Calculate_Click(object sender, EventArgs e) { string workshop; // To hold the workshop string location; // To hold the location double registrationcost; // To hold the Registration Cost double numberofdays; // To hold Number of Days double lodgingFees; // To hold Lodging Fees double totlodging; // to hold the total Lodging Fees double totalcost; // To hold Total Cost if (list_Workshop.SelectedIndex != -1) { // Get the Workshop Selected workshop = list_Workshop.SelectedItem.ToString(); // Determine the Regeistration Fee and Number of Days switch (workshop) { case "Handling Stress": registrationcost = 1000; numberofdays = 3; lbl_Registration_Cost.Text = registrationcost.ToString("c"); if (list_Location.SelectedIndex != -1) { // Get the Location to Figure out cost location = list_Location.SelectedItem.ToString(); // Determine the Location switch (location) { case "Austin": lodgingFees = 150; totlodging = lodgingFees * numberofdays; totalcost = totlodging + registrationcost; lbl_Lodging_Cost.Text = totlodging.ToString("c"); lbl_Total_Cost.Text = totalcost.ToString("c"); break; } } break;I was trying to incorporate the switch element, so far it works ok but having to include a switch for each case seems to make this code a lot longer than it should be, any help is appreciated
Wednesday, February 1, 2012
Chapter 4
This chapter is starting to touch on the items that I normally see on the web. Radio buttons, dropdown lists, ListBoxes, and if else if statements. My least favorite thing in programming is if else if statements, mostly since I hate having to find where I made the error when things don't come out right. Its easier to debug when there's only one statement to look into. Finished the color changer program, I still kinda wanted to put a "default" radio button on one of them to revert the color to the normal grey but didn't. I will likely attempt the next program tomorrow night.
this.Close();Thanks for the help Ken, now I know how to post my code should it give trouble.
Sunday, January 29, 2012
Chapter 3 wrap up
Both the projects were a bit more fun, the Temperature Converter might be more useful than the Stadium seating one. Eventually I would like to try port the Temperature Converter to my Android phone, just so I can easily have a conversion program that I could debug should it need to be. Out of the two programs, the Temperature Converter did give a bit more problems as I made the assumption that C# was as flexible as a graphing calculator and needed parenthesis to separate the (9/5) and (5/9). This ended in a logic error displaying 32 as the answer. I think saving the easiest button for last to program does make things easier. Now, I look forward to typing this.Close(); as it means my program is done.
Wednesday, January 25, 2012
Chapter 3
This was an interesting chapter for me. It started to delve into things that I really enjoy about programming, a way to make code easier. Such ways as using a groupbox so you don't have to edit the tab order, using the & to make it so Alt + (Next Letter) = access key for the button, and Forms vs. Local Variables. The math class section was pretty interesting, wish I had taken this class before any of my math classes. I look forward to attempting the assignments tomorrow.
Sunday, January 22, 2012
Chapter 2 Wrap up and Quiz
Finished the assignments and turned them in. There has got to be an easier way to turn all the label names from visible from invisible than listing each one in the book. There was one question on the quiz that is still wrong from chapter 1 but overall the optional quiz questions seemed to be more correct than they were before. So far I have been enjoying using studio to write code especially the command auto fill in that is sort of like the auto fill in that I use for web browsing. The list that gets brought up makes it easier than having to refer to my memory or the book for the correct code for the program. If Perl had the same type of features I might have enjoyed the assignments a bit more.
Wednesday, January 18, 2012
Chapter 2
After reading the 2nd chapter, it seems as though this book wants us to become more familiar with the gui environment that Visual Studios has. The hello world first coding task was similar to how other programming languages start. It was kinda odd that it showed how to do a multiple event before the Hello World application. This will be the first programming language that isn't pretty much written in notepad so it will be a small change. I look forward to attempting the assignments tomorrow.
Friday, January 13, 2012
Chapter 1 First Impressions
The first chapter in the Visual C# book rehashed some of the concepts that I had learned in other computer classes. Such concepts as algorithms, hardware, software, binary, and others. I have taken mostly networking classes but those concepts seem to stay no matter what class it is. Seeing binary in ASCII was a lot more refreshing than having to subnet a network without a binary calculator. Overall I think this chapter did a good review of basic concepts that will be used a lot more in programming.
Tuesday, January 10, 2012
First Post
My name is Wayne Stark. Currently I am a student enrolled in the Networking Technologies Linux track and have enjoyed taking many different computer classes from Linux system administration courses to video game design. My programming experiences are mostly from the classroom setting having taken the CIS 130 Programming Logic and Design, CIS 183 Video Game Design if that counts as programming, and CIS 248 Perl Scripting. I am taking this course out of curiosity since I am intrigued by all things computer related. Also I do like how programming can make life easier; instead of having to alter large amounts of data, a script can be written to sift through and change certain data.
I hope to gain the knowledge of an object oriented language down and possibly learn java later in the future. Top 3 things on my bucket list. The top item is to travel the world to sample all sorts of culinary cuisines. Next would be to go sky diving, I have done cliff jumping so heights isn't too much of a worry but I do like the idea of falling from thousands of feet from the sky. Lastly would be to learn the guitar, I always loved Rock music because of the guitar rifts but have never learned how to properly play the guitar.
I hope to gain the knowledge of an object oriented language down and possibly learn java later in the future. Top 3 things on my bucket list. The top item is to travel the world to sample all sorts of culinary cuisines. Next would be to go sky diving, I have done cliff jumping so heights isn't too much of a worry but I do like the idea of falling from thousands of feet from the sky. Lastly would be to learn the guitar, I always loved Rock music because of the guitar rifts but have never learned how to properly play the guitar.
Subscribe to:
Posts (Atom)