User Profile

Collapse

Profile Sidebar

Collapse
Hypnotik
Hypnotik
Last Activity: Dec 4 '07, 10:24 PM
Joined: Jun 7 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hypnotik
    replied to Print things out in a table problem
    in C
    Problem is fixed, i started from scratch and had it done in about 10 minutes.

    Thanks to those who took a look.

    J
    See more | Go to post

    Leave a comment:


  • Hypnotik
    replied to Print things out in a table problem
    in C
    Made those 2 changes however the problem is still there.

    For instance when I select graph[0][0] as a yes, so graph[0][0]=1 it prints out a 1 in all columns of 0 instead of just at 0,0.


    J
    See more | Go to post

    Leave a comment:


  • Hypnotik
    started a topic Print things out in a table problem
    in C

    Print things out in a table problem

    Hello everyone. This is a relatively simple program that is driving me crazy. The user enters how many verticies and how many edges. The program then asks where the edges are...in a 2D array. If the user enters a 1 (indicated there is an edge) that array element is set to 1. For some reason my print out is all wrong. It prints out to many elements, and incorrect values.

    Any help is appreciated, I think I'm just missing some minor thing....but...
    See more | Go to post

  • Hypnotik
    started a topic Cache Memory Simulation problem
    in C

    Cache Memory Simulation problem

    My program is to simulate cache memory. I read in the info from 2 external files, 1) access 2) data in memory. When I read the information in I display the info...and it is all correct. However when I attempt to display the info in main anywhere the info is incorrect. I thought it might be a problem while I was reading the data in, but it wouldn't be correct the first time if that were the case. Below is the code. At the end of main where the...
    See more | Go to post

  • Hypnotik
    replied to Adding 2 polygons together
    in C
    Ok so I've worked on the problem some more, and unfortunately I can't edit the other post to remove that code. I have added 6 overloaded operator functions however I am receiving an error. The error has to do with the return value in those newly added functions. I receive a syntax error ';' on the return statement line, however if I remove the semicolon I receive another error.

    Code:
    #include <iostream>
    using
    ...
    See more | Go to post

    Leave a comment:


  • Hypnotik
    replied to Checkers board game program
    in C
    So I've worked on the code some more and it has changed quite a bit. My problem now is, that I can move a human piece to any "shaded" spot on the board. I'm not sure how to correct this. The code is not completely cleaned up so I appologize.

    Code:
     
    
    #include <iostream>
    #include <time.h>
    #include <ctype.h>
    using namespace std;
    class Board
    {
    public:
    ...
    See more | Go to post

    Leave a comment:


  • Hypnotik
    replied to Adding 2 polygons together
    in C
    I can pick any side....the instructor said it doesn't matter

    J...
    See more | Go to post

    Leave a comment:


  • Hypnotik
    replied to Adding 2 polygons together
    in C
    Heh...yeah that doesn't make sense. Say I am adding a triangle and a rectangle. When those shapes are added together, I will have a shape which is now neither a triangle or rectangle...it will be a polygon. The length of the side that is on the triangle, where the rectangle is added, will change. That is where the comparison comes in. The length of the side (on the triangle) will have to have the length of the rectangle side subtracted from...
    See more | Go to post

    Leave a comment:


  • Hypnotik
    started a topic Adding 2 polygons together
    in C

    Adding 2 polygons together

    Hey everyone. I'm writing a program which allows the user to enter information about 2 shapes, either a square, triangle, or rectangle, then 'adds' the shaps together. The resulting shape is a polygon. I understand how this is done, just not sure about the code. I need to overload the + operator to add the shapes. Also I know that I need to make a comparison between sides begin combined, and subtract the smaller side from the area. Also I understand...
    See more | Go to post

  • Hypnotik
    replied to Quick multiple inheritance question
    in C
    Unfortunately it is required in the assignment. I'll get to borders or barnes and check the book out, although I may not be able to throw out $60 for 1 assignment. What I've gathered from reading articles and examples on the net is that multiple inheritance seems to cause more problems than it's worth. Oh well...I'll meet with the instructor and see what his suggestions are.

    Thanks for taking a look.

    J...
    See more | Go to post

    Leave a comment:


  • Hypnotik
    replied to Another noob header question
    in C
    I think you need a destructor function for your mstring class.

    J
    See more | Go to post

    Leave a comment:


  • Hypnotik
    replied to Quick multiple inheritance question
    in C
    Hey weakness. I've tried using the virtual void getinfo function, and inheriting the virtual public classname however I still receive the same results. In my student worker class I call both getinfo functions, should I only be calling one of them? I don't think that would correct the problem because I still need some info that is not in (for instance) the worker class.

    J...
    See more | Go to post

    Leave a comment:


  • Hypnotik
    replied to Problems with my code
    in C
    When I compiled the program I received various errors. I think the problem is that you are not initializing your array to zeroes. For example, you're assigning score[0] the value n. What is the value of n? Also you are not storing any values in the array, that's where your other for loop would come in to play.
    J...
    See more | Go to post

    Leave a comment:


  • Hypnotik
    replied to C++ code help (Newbie project)
    in C
    Hey Redmoon. You also need to:

    Code:
    #include <iostream>
    using namespace std;
    The iostream allows the use of cin and cout statements.

    Also:

    Code:
    cout << "Hello world!!!!." << end1;
    should be:

    Code:
    cout<<"Hello world!!!!."<<endl;
    ...
    See more | Go to post

    Leave a comment:


  • Hypnotik
    started a topic Quick multiple inheritance question
    in C

    Quick multiple inheritance question

    Hello everyone. I'm working on multiple inheritance program. I have a pretty specific problem that I'm not sure how to overcome. I'm going to try to explain this as simple as possible. There is a person class which has some info. A student class, which inherits the person info, and has some additional info. A worker class which has it's own info, and inherits the person info. A student_worker class which inherits from all of the above classes. Now...
    See more | Go to post

  • Hypnotik
    replied to Inheritance question
    in C
    How would this work? I ask in main the number of sides. If 4 is selected I ask if it is a polygon, a rectangle or a square, then call the respective setlength function. The setlength function would be declared in the polygon class, the the 3 derived classes would inherit just that. If 3 is selected it would call the triangle.setlen gth, and if a number greater than 4 is selected it would call the polygon.setleng th function? I'm just confused...
    See more | Go to post

    Leave a comment:


  • Hypnotik
    replied to Inheritance question
    in C
    I would assume that square would derive from rectangle, but it's not what the assignment says. I'm assuming that is a mistake. The program has length involved because the next assignment is going to calculate area and perimeter of the shapes.
    See more | Go to post

    Leave a comment:


  • Hypnotik
    started a topic Inheritance question
    in C

    Inheritance question

    So I'm working on a program. Base class is a polygon (which has an unknown number of sides), with derived classes for rectangle and triangle which inherit from the polygon, and square which inherits from triangle. In my base class I have 2 private members: num_sides and length. Also in my base class I have a setnum_sides() and setlength() function. Do I simply call these 2 functions to set the num_sides and length for all shapes? It seems a...
    See more | Go to post

  • Hypnotik
    started a topic Checkers board game program
    in C

    Checkers board game program

    So I'm writing this program. I have the board constructed, and I'm having a problem making a move. At this point I just want to make a move, I'll work on whether it is a legal move after that. The code is posted below. I have a class for board, and the pieces are part of the board class. I also have a class for human move and computer move, however I'm not using those (yet). I don't know whether I need to use a seperate class for the move,...
    See more | Go to post

  • Hypnotik
    replied to Tally machine program
    in C
    Problem has been resolved.

    J
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...