lol - at least you know that i'm no expert.
thanks for taking a look anyways.
Type: Posts; User: benjamin923
lol - at least you know that i'm no expert.
thanks for taking a look anyways.
Challenge problem: Where are the two errors???
//Homework 18.4
//Benjamin Stollerman
//CS 1050
#include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
using namespace std;
Thanks for your help guys...
I for got to add the #include<iomanip> - duh!
Thanks for that advice - anything to save time and space helps a bunch.
now if i can only figure out the other part....(next post on board) AHHHHH
So the first half of my code to find the average works:
int main()
{
const int SIZE = 5; //max array size
double x[SIZE] = {1,5,6,8,10};
int num_points = 0; //array index
double sum =...
I figured out how to do the avg:
int main()
{
const int SIZE = 5; //max array size
double x[SIZE] = {1,5,6,8,10};
int num_points = 0;
double sum = 0;
Yea, i can do it by hand easily...what I don't understand is how to add each element to the next one. If you can help me with that I would really appreciate it. Here's what I have:
double avg =...
What is an example of a function I would use to find the average value if I have an array of known size?
i.e.
const int LENGTH = 5;
double a[LENGTH] = {1,5,6,8,10};
double avg;
double...
Yes-to clarify...if I have an array
{a,b} and an array {c,d} I need to write a function to
(a+c) + (b+d)
Thanks for your help.
I'm having trouble figuring out how to manipulate two arrays. The arrays are listed below.
double z1[2];
double z2[2];
z1[0] = a;
z1[1] = b;
z2[0] = c;
z2[1] = d;
*where...