help needed (arrays)

This is a discussion on help needed (arrays) within the C++ Programming forums, part of the General Programming Boards category; i been asked to create a program in which you enter 2 numbers to four different classes ( car, van, ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    2

    help needed (arrays)

    i been asked to create a program in which you enter 2 numbers to four different classes ( car, van, SUV, truck) and the amount (the 2 num)
    ( X, 20)
    and to get out of the loop you have to type EOF.

    Please help me!

    #include <iostream.h>
    int main ()
    {
    char class;
    int amount, count;
    for (count=0; count<999; ++count)
    cout<<"please enter your class"endl;
    cin>>class;
    cout<<"please enter the amount"<<endl;
    cin>>amount;

    now how can i display all of the amounts by each class? and the totals of them?
    Last edited by mana; 05-08-2002 at 09:59 AM.

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    You really should have paid attention to your teacher. "class" is obviously supposed to be just that: a class. I'm guess something like:

    Code:
    class TestClass
    {
    private:
       char ClassType;
       int ClassValue;
    public:
       TestClass();
       ~TestClass();
      //put your other member functions here
    };

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with some arrays.
    By Poisonhearts in forum C++ Programming
    Replies: 5
    Last Post: 11-16-2007, 10:14 AM
  2. Passing pointers to arrays of char arrays
    By bobthebullet990 in forum C Programming
    Replies: 5
    Last Post: 03-31-2006, 04:31 AM
  3. Vertex Arrays
    By Shamino in forum Game Programming
    Replies: 2
    Last Post: 01-08-2006, 12:24 AM
  4. Need Help With 3 Parallel Arrays Selction Sort
    By slickwilly440 in forum C++ Programming
    Replies: 4
    Last Post: 11-19-2005, 09:47 PM
  5. Building B-Tree from Arrays
    By 0rion in forum C Programming
    Replies: 1
    Last Post: 04-09-2005, 02:34 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21