here is the correct version:
double total = 0, average = 0, min = 101, max = 0;
for (int x = 0; x < counter; x++)
{
total += scores[x];
if (scores[x] > max)
max=scores[x];...
Type: Posts; User: kbpsu
here is the correct version:
double total = 0, average = 0, min = 101, max = 0;
for (int x = 0; x < counter; x++)
{
total += scores[x];
if (scores[x] > max)
max=scores[x];...
i modified my program and it is almost there:
double total = 0, average = 0, min = 101, max = 0;
for (int x = 0; x < counter; x++)
{
total += scores[x];
if (scores[counter] > max)...
were winding down the semester and just running through some simple (i think) arrays. the description of the assignment is:
Write a program that prompts the user for test scores (doubles). The user...
i did read your post, and i dont understand why you think it doesnt work? it works just fine for me, exactly like it should... except for the last part.
that was the full assignment description. the program works fine for everything except the condition in which it needs to stop immediately.
got it working, thanks a lot. the final output is
#include <iostream>
#include <cmath>
using namespace std;
double num;
double mySquareRoot(double)
buzzbuzz, i tried what you said to do, and i am getting some other errors now.
#include <iostream>
#include <cmath>
using namespace std;
int num;
double mySquareRoot(int)
ive gotten rid of a lot of errors now with your help, this is what i have so far.
#include <iostream>
#include <cmath>
using namespace std;
double mySquareRoot()
{
return sqrt(num);
}
do i put that instead of the 'double mysquareroot(int num)'?
this is another simple (i think) function that i have to complete for an assignment. the assignment description is:
Write a program with a function called mySquareRoot. In main, prompt the user...
the only thing is that the user isnt entering their name. its a program that we have to write which when we run it, our name just automatically comes up. also, we arent supposed to use cout. the...
what are you referring to when you say i need to 'call' the function? and how will i be able to print the string returned without cout? (i am assuming that the 'return' command has something to do...
we are starting to learn about functions now and we have a simple function that we have to do. i was looking through my book, but all the examples were using int and not string (which is what i...
thanks edoceo for the help. i actually just figured it out right now. in case anyone was wondering, here is what it should look like (or at least what works for me):
#include <iostream>...
i am working on this program for my class, and i almost have this figured out. the problem is that since chocolate can be referred to as 2 different answers, that is where my program is going wacky....
thanks for the quick response. and for being very helpful.
i figured out how to incorporate the switch statements into this program, but i am having trouble making the error term come up if the user tries to divide by zero.
#include <iostream>
using...
ahhh, nevermind. i figured that problem out. i had to switch the order of the else if statements (put the one with the error message before just the one with the / symbol).
now i have to modify...
i did what you said, and it is still coming up with what has been coming up. funny enough, my professor told me the exact same thing you (laserlight) told me. i switched them and made it n2 ==...
i tried doing something like this:
#include <iostream>
using namespace std;
int main()
{
double n=0, n2=0;
char operation;
cout << "Current Total is " << n << endl;
youre great man. thanks a lot. there is only 1 problem. when the user enters '/' and then enters the # 0, it is supposed to come up with a message and display the previous number.
would that be...
yeah, the user is supposed to enter the number after putting in the desired operation. so if the number was 40, and the user selected '-' and put in the number 3, the new number should be 37.
i...
i have been working on this forever. i looked in my book everywhere and cant seem to find how to finish this. the if statements work, but i cant seem to find out how to make the previous number be...
thanks for the quick response. i think i am on the right track, but being that the operation comes before the first number entered, the 'new' number displayed is coming out with something all...
whats up fellas. another assignment that is due somewhat soon that i have some questions on. the assignment description is:
Write a simple calculator program. Ask the user if s/he wants to add...