plz need yr helpe !! it's last day 2 submit :(

This is a discussion on plz need yr helpe !! it's last day 2 submit :( within the C++ Programming forums, part of the General Programming Boards category; Hi 4 all.. i'm new in this fourm and i hope will be interested with u .. i faind some ...

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    1

    plz need yr helpe !! it's last day 2 submit :(

    Hi 4 all..
    i'm new in this fourm and i hope will be interested with u ..
    i faind some problem i this program and i need yr help plllllllllz !
    this is the link of the Q --> The Statistician Class

    and this is what i do ..i really work so hard but still i didn't get it !!!


    #include<iostream>
    #include "stats.h"
    using namespace std;

    class statistician
    {
    public:

    void statistician::next(double r)
    {


    if(coun==0)
    {
    count++;
    total=r;
    smallest=r;
    largest=r;
    }
    else
    {
    count++;
    total=total+r;
    if(r<=smallest)
    r=smallest;
    if(r>=largest)
    r=largest;
    }
    }





    double mean()const
    {

    if (count > 0)
    return total/count;
    else
    return -1;

    }


    double statistician::length()const
    {
    return count;
    }

    double statistician::recent()const
    {
    count=0;
    smallest=0;
    largest=0;
    total=0;
    }
    double statistician::minimum()const
    {
    if(count>0)
    return smallest;
    else
    return-1;

    }
    double statistician::maximum()const
    {

    if(count>0)
    return largest;
    else
    return-1;
    }
    double statistician::abs_minimum()const
    {
    asser(length()>0);
    x=p_abs(smallest);
    y=p_abs(largest);

    if(x>y)
    {
    return x;
    }
    else
    return y;
    }

    double statistician::abs_maximum()const
    {
    asser(length()>0);
    x=p_abs(smallest);
    y=p_abs(largest);

    if(x<y)
    {
    return y;
    }
    else
    return x;
    }
    double statistician::statistician::sum()const
    {
    return total;
    }
    statistician operator +(const statistician& s, const statistician& t)
    {
    statistician c;
    c.next(s.sum()+t.sum());
    return c;


    }

    statistician operator *(double scale, const statistician& s)
    {
    return s;
    }

    };

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,499
    Somehow, it's always the last day before the panic sets in.

    Somehow, it's also inevitable that these threads go unread.
    C Board - Announcements in Forum : C++ Programming
    << !! Posting Code? Read this First !! >>
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    A lack of planning on your part does not constitute an emergency on ours. Besides even if we had time to help we are not going to do your homework for you.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. tomorrow is last day to submit
    By asad_fit786 in forum C++ Programming
    Replies: 14
    Last Post: 10-22-2009, 09:37 AM
  2. Should I learn a FULL language first?
    By Raeliean in forum Game Programming
    Replies: 8
    Last Post: 07-16-2005, 06:59 PM
  3. Airline Booking System - PLZ HELP
    By Gecko2099 in forum C Programming
    Replies: 5
    Last Post: 03-26-2005, 11:17 AM
  4. debug program
    By new_c in forum C Programming
    Replies: 3
    Last Post: 03-18-2002, 10:50 PM
  5. Simplified code
    By soonerfan in forum C Programming
    Replies: 2
    Last Post: 12-05-2001, 02:50 PM

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