Forum: C++ Apr 1st, 2007 |
| Replies: 11 Views: 1,854 So you need to create a linked list with three nodes and then call a function that follows the links and counts the number of nodes...is that correct? |
Forum: C++ Feb 27th, 2007 |
| Replies: 16 Views: 3,652 I'm just learning C++ myself...
Wouldn't you use a public member function to access and modify private member variables? |
Forum: C++ Feb 27th, 2007 |
| Replies: 4 Views: 1,676 Just glancing at the code, would this modification work?
unsigned int getVolume() {
setVolume();
return Volume;
} |
Forum: C++ Jan 16th, 2007 |
| Replies: 1 Views: 1,036 Nevermind...
I got it to work using
char &operator[](unsigned int index) {
return str[index];
} |
Forum: C++ Jan 16th, 2007 |
| Replies: 1 Views: 1,036 I was absent for the discussion and lab due to illness and I am at a total loss as to how to do this assignment.
Implement the my_string class in header file my_string.h, so that the test code... |
Forum: C++ Dec 10th, 2006 |
| Replies: 15 Views: 2,980 I had a midterm problem similar to this last year.
The question was
My solution (as a module of the entire midterm program) is as follows:
// Frank C. Jamison
// April 08, 2006 |
Forum: C++ Sep 20th, 2006 |
| Replies: 14 Views: 2,815 Man...my spelling really blew chunks on that one...lol
I need to learn to proof-read before I hit post! |
Forum: C++ Sep 20th, 2006 |
| Replies: 14 Views: 2,815 Also...it you want to get your doubles to print as numbers instead of E notation, use cout << fixed; |
Forum: C++ Sep 20th, 2006 |
| Replies: 14 Views: 2,815 Straight from the textbook...
When a variable is assigned a number that is too large for its data type, it overflows. Likewise, assigning a value that is too small for a variable causes it to... |
Forum: C++ Sep 20th, 2006 |
| Replies: 14 Views: 2,815 I think we lost track of the question...
He wanted to know WHY this happened using an int...not alternatives to using an int. |
Forum: C++ Sep 20th, 2006 |
| Replies: 14 Views: 2,815 True...the data types and sizes shown are typical on Windows systems, and the sizes and ranges may be different on other operating systems...
You can determine the size of an integer using... |
Forum: C++ Sep 20th, 2006 |
| Replies: 14 Views: 2,815 This is because of the size limitations of data types.
an int is only 4 bytes...and has a range from -2,147,483,648 to 2,147,483,647
A double uses 8 bytes (and some floating point algorithm... |
Forum: C++ Sep 18th, 2006 |
| Replies: 6 Views: 1,469 |
Forum: C++ Sep 18th, 2006 |
| Replies: 6 Views: 1,469 Kind of...the best thing to do is write down the process first
get start time in military format
convert start time to minutes
int startMin = ((startTime / 100) * 60) + startTime % 100
get... |
Forum: C++ Sep 18th, 2006 |
| Replies: 6 Views: 1,469 Ah..I just saw the bottom part...the minute hour thing is kind of tricky
convert your start and end time to minutes...so that all of your calculations are done in minutes...
the final step... |
Forum: C++ Sep 18th, 2006 |
| Replies: 6 Views: 1,469 Logically...you have a start time and an end time stored in variables.
create a third variable to hold the total time (start time - end time)
multiply the total time by 0.75 (totalTime*0.75)... |
Forum: C++ Sep 17th, 2006 |
| Replies: 2 Views: 3,772 Here is the definition of algorithm...
http://en.wikipedia.org/wiki/Algorithm |
Forum: C++ Sep 17th, 2006 |
| Replies: 11 Views: 2,409 Here's the big glaring error I see in your code...
string string;
You can't use "string" as a variable name. |
Forum: C++ Sep 17th, 2006 |
| Replies: 11 Views: 2,409 Ha.! I remember my C++ instructor promising not to give us a bad grade on an assignment if we promised not to use global variables...lol |
Forum: C++ Aug 20th, 2006 |
| Replies: 4 Views: 12,810 I'm not normally in the habit of handing out homework solutions...but you need to see a working example.
This is a working program:
#include <iostream>
using namespace std;
int main() {
... |
Forum: C++ Aug 20th, 2006 |
| Replies: 4 Views: 12,810 No...and no.
Your for loop should be formatted similar to
for(int i = 0; i < count ; i++) {
average += grade[i];
} |