Forum: C++ Dec 8th, 2008 |
| Replies: 2 Views: 279 Yes, I have the do while set to go on forever until I get on to the solving part, but while trying to shrink my program down so I can make it more modular, the O's that player 2 have are showing up... |
Forum: C++ Dec 8th, 2008 |
| Replies: 2 Views: 340 Yeah, my bad, I marked as solved so it'll drop.
and to note
if ( grid[rows][cols] = 'O')
{ cout << "This space has been taken, enter another row and column";
cin >> rows >> cols; }
is what... |
Forum: C++ Dec 8th, 2008 |
| Replies: 2 Views: 340 I'm currently writing code for a soon to be simple tic tac toe program. Currently i'm just testing out methods of how to run it, so it'll be more "modular" in the end but for now I'm just testing... |
Forum: C++ Dec 1st, 2008 |
| Replies: 9 Views: 633 Figured it out
double getLargest(double array[], int size, int &i)
{
double largest = array[0];
for (int count = 0; count < size; count++)
{ if (array[count] > largest)
{largest =... |
Forum: C++ Dec 1st, 2008 |
| Replies: 9 Views: 633 the getLargest function needs to get both the index for the month and the largest value. I can't change anything in main, as it was given, so it needs to be a double. Do I need a nested for loop? |
Forum: C++ Dec 1st, 2008 |
| Replies: 9 Views: 633 I was using count because the examples that were shown used count as the name. I understand that that count should be 0, so the loop will end at 12, but i'm still struggling to understand how to get... |
Forum: C++ Dec 1st, 2008 |
| Replies: 9 Views: 633 I fixed the function call, now the only problem is that it won't display the month with the largest/smallest data. Here's what it shows, along with the code following.
Enter the rainfall (in... |
Forum: C++ Dec 1st, 2008 |
| Replies: 9 Views: 633 lol I forgot to change the array back to 0, I was just messing around with things to see what would happen. And for the getAverage I can't seem to get it to work properly. Everytime I call getTotal... |
Forum: C++ Dec 1st, 2008 |
| Replies: 9 Views: 633 I've got executable code that is partially working, so i know i've done something wrong in it. In it you type in the rainfall for each month in inches and will display the total, average, largest... |
Forum: C++ Nov 19th, 2008 |
| Replies: 4 Views: 332 Don't know what I was thinking there. I changed it to just greater than and then inbetween the two for loop I made total = 0 again. Both arrays outputted -20 so that seems to be working properly. ... |
Forum: C++ Nov 19th, 2008 |
| Replies: 4 Views: 332 I'm really not understanding what's going on with the array in this. Here's the question.
The following code totals the values in each of the two arrays. Will the code print the correct total for... |
Forum: C++ Nov 17th, 2008 |
| Replies: 5 Views: 414 I've been trying to use dot operators but I can't get anything to work with whats in main(which cannot be changed).
And about the function definition data type. With the setup I have to use, the... |
Forum: C++ Nov 17th, 2008 |
| Replies: 5 Views: 414 Nobody? I've got it where it displays
Title :
Director :
Year Released: -858993460
Running time : -858993460 minutes
Title :
Director :
Year Released: -858993460... |
Forum: C++ Nov 17th, 2008 |
| Replies: 5 Views: 414 Found a problem, and now it's executable code. Still has problems though. The year/time is showing up as negative eighty thousands and the director/title are blank. two warnings with the year and... |
Forum: C++ Nov 16th, 2008 |
| Replies: 5 Views: 414 Here's the problem, questions at the bottom.
Write a program that uses a structure named MovieData to store the following information about a movie:
Title
Director
Year Released
Running... |
Forum: C++ Nov 12th, 2008 |
| Replies: 6 Views: 364 Okay, I made ThreeVals not a void function and it seems to have worked. Tell me if this is correct or not please.
#include <iostream>
using namespace std;
struct ThreeVals
{
int a, b, c; |
Forum: C++ Nov 12th, 2008 |
| Replies: 6 Views: 364 yeah I noticed the dot operator from another fix I did, that was pretty simple. Now I'm going to look up constructors. |
Forum: C++ Nov 12th, 2008 |
| Replies: 6 Views: 364 errors are:
error C2380: type(s) preceding 'ThreeVals' (constructor with return type, or illegal redefinition of current class-name?)
error C2679: binary '<<' : no operator defined which takes... |
Forum: C++ Nov 12th, 2008 |
| Replies: 6 Views: 364 I don't usually ask for help on these but I missed a day of class and I'm a bit out of the loop. We're going over structures and for HW my instructer likes to do code fixes where theres code with... |
Forum: C++ Nov 3rd, 2008 |
| Replies: 2 Views: 395 #include <iostream>
#include <iomanip>
using namespace std;
void celsius(int);
int main()
{
cout << setprecision(2) << fixed << showpoint;
cout << "This program displays a table of the... |
Forum: C++ Oct 21st, 2008 |
| Replies: 3 Views: 477 I haven't gotten into arrays yet, but it seems like that's the way to go. For this, how would I state tha size can be unlimited? It's a series of integers, so I couldn't set it to a constant. |
Forum: C++ Oct 20th, 2008 |
| Replies: 3 Views: 477 #include <iostream>
using namespace std;
int main()
{
int num, greatest, least;
char doAgain;
do |