A. Objective: Continue studying for the exam. Tackle the wonderful world of the STL linked list. Soooooo much easier than creating one from scratch.
B. Program:
Complete program with output
C. Comment:
This was basically a chance to redo the last lab. I created a list of strings and then opened a file to read the story from. I display it to the screen, sort it, reverse it, remove the repetition from it. I wish everything could be done with this much ease.
Saturday, May 5, 2007
Wednesday, May 2, 2007
2D Array Operations
A.Objective: Practice my programming skills for the final. 2D Array Problem #18 p. 451
B.Program:
The Code
C.Comment:
Not having worked with a 2D array in a very long time, I had to use the book to jog my memory. Luckily the book had most of the code I needed and what it didn't, just required a little tweaking to get what the problem asked for. The display isn't all that pretty, but it gets the job done.
B.Program:
The Code
C.Comment:
Not having worked with a 2D array in a very long time, I had to use the book to jog my memory. Luckily the book had most of the code I needed and what it didn't, just required a little tweaking to get what the problem asked for. The display isn't all that pretty, but it gets the job done.
Lowest Score Drop
A.Objective: Practice my programming skills for the final. (2)Programming Challenge from Chapter 6
B.Program:
The Code
C.Comment:
This program took a little more thought. Also in order to follow their instructions, this program isn't written in the most practical way possible. There are things that could have made it shorter, such as putting the scores in a vector. This way it could have sorted it for me and found me the lowest score without all the if statements. I am proud of the way, I figured out how to calculate the average. The thought came to me, before I fell asleep.
B.Program:
The Code
C.Comment:
This program took a little more thought. Also in order to follow their instructions, this program isn't written in the most practical way possible. There are things that could have made it shorter, such as putting the scores in a vector. This way it could have sorted it for me and found me the lowest score without all the if statements. I am proud of the way, I figured out how to calculate the average. The thought came to me, before I fell asleep.
Monday, April 30, 2007
Markup Program
A.Objective: Practice my programming skills for the final. 1)Programming Challenge from Chapter 6
B.Program:
My program
C.Comment:
I was successful in writing a program that takes from the user, the wholesale cost of an item and its markup percentage and calculate the retail cost of the item. It was basically a review on functions. I had to do some error checking and did have quite a few syntax errors that were solved easily.
B.Program:
My program
C.Comment:
I was successful in writing a program that takes from the user, the wholesale cost of an item and its markup percentage and calculate the retail cost of the item. It was basically a review on functions. I had to do some error checking and did have quite a few syntax errors that were solved easily.
Monday, April 9, 2007
April 10th
A. Objective: Write code in C++, very simple code that doesn't add to my already painful headache
B. My Program:
Visual Only: Hehehe-click here
C. I suceeded! My headache didn't get worse and I used C++ syntax.
B. My Program:
Visual Only: Hehehe-click here
C. I suceeded! My headache didn't get worse and I used C++ syntax.
Wednesday, April 4, 2007
April 5th
A.Objective: To write a simple program that actually has some kind of worth using my limited knowledge of C++.
B.Program
Take a gander right here:
.h file
.cpp file
C. Update: Chatted with Prof Coyle and I think I figured out my problem, I was doing integer division, so it was messing up my answer.
So, I was very proud of myself for writing a program that worked, until I discovered a problem in it. I'm so annoyed, I thought it was working correctly until I tested it out again before posting. The point of the program is to convert temperatures from celsius to fahrenheit and vice-a-versa. Well the conversion from celsius (C)to fahrenheit(F) works, but the fahrenheit to celsius doesn't. The only one that work for F to C is when I put in 32F and get 0C. Everytime I enter a degree in F, I get 0 C as the answer. Can someone help me figure out the problem as I have triple checked my formula and made all the changes I could think of and I can't figure it out.
B.Program
Take a gander right here:
.h file
.cpp file
C. Update: Chatted with Prof Coyle and I think I figured out my problem, I was doing integer division, so it was messing up my answer.
So, I was very proud of myself for writing a program that worked, until I discovered a problem in it. I'm so annoyed, I thought it was working correctly until I tested it out again before posting. The point of the program is to convert temperatures from celsius to fahrenheit and vice-a-versa. Well the conversion from celsius (C)to fahrenheit(F) works, but the fahrenheit to celsius doesn't. The only one that work for F to C is when I put in 32F and get 0C. Everytime I enter a degree in F, I get 0 C as the answer. Can someone help me figure out the problem as I have triple checked my formula and made all the changes I could think of and I can't figure it out.
Monday, April 2, 2007
April 3rd
A.Objective: Learn more about pure virtual functions for the test.
B.Program:
My .h files:
Student.h
EngStudent.h
All-in-One, i.e. output included
My .cpp files:
EngStudent.cpp
C.Comment:
This program from the book helped me to understand pure virtual functions better. I now know the syntax and why they are used. The base class in which the pure virtual function is declared can never be instantiated. I hope this will help me on the test.
B.Program:
My .h files:
Student.h
EngStudent.h
All-in-One, i.e. output included
My .cpp files:
EngStudent.cpp
C.Comment:
This program from the book helped me to understand pure virtual functions better. I now know the syntax and why they are used. The base class in which the pure virtual function is declared can never be instantiated. I hope this will help me on the test.
Subscribe to:
Comments (Atom)