Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Programming help

Name: General Butt Naked 2012-02-17 19:52

Okay /prog/,

I need some quick help.

http://i.imgur.com/cSAvU.jpg

I got part A done with no problem.

My question is how do I use while and do whiles to store each data set's average and then print it out after a 0 is read.

Here is what I have so far

http://pastebin.com/MuSwgHNv

Thanks

Name: Anonymous 2012-02-17 19:53

This is c++ by the way.

Name: Anonymous 2012-02-17 19:54

Fuck C++

Name: Anonymous 2012-02-17 20:05

You don't need to store data set's averages. Just print them as you finish their calculation.

But, if you insist, just use a list to hold their values.

#include <list>
#include <iostream>

int main() {
  std::list<float> v;
  float avg;
  while (/* exit condition */) {
    /* calculate each dataset's avg */
    v.push_back(avg);
  }
  for (std::list<float>::iterator i = v.begin(); i != v.end(); i++) {
    std::cout << *i << '\n';
  }
}

Name: Anonymous 2012-02-17 20:19

>>4
I see now. I didn't comprehend that last line. I just saw the input and output and assumed that was what need to be printed exactly to the screen.

Sorry, I am an idiot.

Name: Anonymous 2012-02-17 20:22

>>5
Are you not, I am.

Name: Anonymous 2012-02-17 20:57

I'm not clicking your stupid links to read your shitty tasks, if you don't even make the effort to at least post your issues in this thread why would I help you?

Name: Anonymous 2012-02-17 21:01

>>7
The problem was already solved, dude. Don't waste your time.

Name: Anonymous 2013-09-01 19:23



         ,.‐''"´ ̄`"'' ー ''"´``'ヽ、
       ;'  '⌒ヽ,   ,.-、_     `ヽ、_,..,_
     ,.、,/     '、_ノ__      `Yン'´::::::::`;
    ノ,.-'-‐'ー‐'-‐'"´_,,.._`>ー-‐○r'"`)::::::::::i
   ,'´く.,___,,.. - ''"´:;::::::;:::::::::::_!:::';::ヽ;:::::::;'::::::::::;'
   i:::::く/::::::::/:::::_!;/|:::/!:::7´_」_:::!::::::';:::i::::::::::ハ    _,,.... -‐- 、.
   !::::::;'::::::::::!,'`7_」_レ' ヽ/'´,.-,、`Y:::::!:::';::::::;'::,!. ''"´      `;
   ';:::::i::i:::::::::!ァ'´,-、      ! ,ハ .ハノ::::::ヽ;:,'´    _,,..,,__,,.. -''´
    ヽ;:レ!:::::::;!! i ハ     `"´⊂⊃::::::/i''ー:; ''"´
     )::`ヽ:ハ `"´ ,..,-‐-、  ∠:;_;;::;:'::| !::::::':,
     ,':::::::ノ::::⊂⊃  V   ノ ,.イ:::ハ:/:::::! ('、::::::!  アメリカンドッグくださーい
     !/(::::r'i::::|`T.ァー-,-‐ァ'´/レ`/ヽノ、  ヽ、::|
    i)  ヽ!ヽ/`ヽr''"/´i/  _」/ `ヽ;::ヽ,  )'
         ´ /´`ヾ,ヘ_∞r'7´ `ヽ /`7i::::_」
          ri   ノ),/ゝ、i    ハヾ' !:::::::|
         ,/ヽ、_ンiイ♀、 ゝr、_ノ ノヽ、,!:::::::!
         !    ,ハ/ハ \トー‐''   ,ハ_;ノ
         '、,__,/ゝーァ´`''ーヽ、.,__,,..イ´ ヽ、
           `ア´ /       ヽ.    `7'ァー、
           /  /          ,ゝ、  `''ー-/
        r''">'   ,--.,  _____   〈_/';   /
        ヽ、.,  / ̄/  |ー‐i    ';/  /
          `7ヽ、´..,,__ └‐┘_____,,,... -,t'´、
          ;'ー-、/     ̄ ̄    ヽ、,_ノノ ハ`、     ,.-‐-、
       , '⌒'ヽ、, /               `!ー ' i |  -=、    )
        i'⌒ヽ、 /                 '、___ノノ    ` ー '
    ─━`''ー--`'━━━━━━━━━━━━━━─

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List