I'm trying to write a program that will add in an unknown series of numbers then divide it by the number of numbers to get an average. Can I use an array for that?
Type: Posts; User: boxsterh
I'm trying to write a program that will add in an unknown series of numbers then divide it by the number of numbers to get an average. Can I use an array for that?
How can I input an unknown number of numbers and have eachone declared as some sore of int ? Is this even possible?
I'm sorry, I didn't see the re-written code. Thanks!
My compilier says there's a linker error...
I'm trying to use the following in a program, but seem to be getting an error. Any ideas why?
bool greater (int a, int b)
{
if (a > b)
return true;
}
OK, so in order for me to get the info I want I would need to:
1) use getline() to put my file into string
2) use find() to get the position of "@"
3) run some kind of test to pick up the...
Hi all. I'm curious if there's a way to use the find function to find a certain character, then the get function to get that complete string? For example, if I were to find the "@" in a file and then...
I obviously don't get what is to be done, but I thank you all for your help anyway.
OK, if I read this right, var1 should become MIDDLE, yes? but the program I'm using gives me an error of: "no match for 'operator=' in '(&std::cin)->std::basic_istream<_CharT, _Traits>::get [with...
I'm not asking for someone to do the program for me, I had asked you to please give me a little more clarification on how to use the commands you had shown.
//******************************************************************
// PrintName program
// This program prints a name in two different formats...
I'm sorry, I'm still confused.
Would you mind showing me an example?
My assignment is to use an input file of names, and have a program break the names down in first-last, and last-first-initial format. And to use an End Of File loop to terminate. My proglem is that...
No loops can't be used. Loops is in our next chapter though. Do you have any ideas? Keep in mind this is a beginning programming class.
Thank you so much!
// display output
cout << "Patient's name " << name ;endl
;cout << "Cleaning Charge is " << cbill
;cout << "Cavity filling charge is " << cavbill
;cout <<...
cout << "Patient's name " << name
;cout << "Cleaning Charge is " << cbill
;cout << "Cavity filling charge is " << cavbill
;cout << "X-ray charge is " << xbill ...
I do have one more question. My output screen has all the information running together, when i'd rather have it list line by line. how do i get that?
Aiya!!! Thank you so much!!
#include <iostream>
using namespace std;
int main ()
{
string name; //input variaable for patient's name
string::size_type namlen; // used for determining string size
char...
OK, how would I check my dataOk variable?
char xray;
char cavity;
char cleaning;
float xbill;
float cavbill;
float cbill;
float totalbill;
bool dataOk;
cout << " Was cleaning performed? (Y or y = yes, N...
When i put the above code in, i get this response: "ISO C++ forbids comparison between pointer and integer"
Hi, I'm taking a C++ class, and my teacher isn't really clear. Our assignment deals with answering Yes or No questions to figure out a bill for work done. Also involved we have to test the input to...