Search:

Type: Posts; User: kbpsu

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Thread: arrays

    by kbpsu
    Replies
    3
    Views
    1,645

    here is the correct version: double total =...

    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];...
  2. Thread: arrays

    by kbpsu
    Replies
    3
    Views
    1,645

    i modified my program and it is almost there: ...

    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)...
  3. Thread: arrays

    by kbpsu
    Replies
    3
    Views
    1,645

    arrays

    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...
  4. Thread: sqrt function

    by kbpsu
    Replies
    16
    Views
    14,560

    i did read your post, and i dont understand why...

    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.
  5. Thread: sqrt function

    by kbpsu
    Replies
    16
    Views
    14,560

    that was the full assignment description. the...

    that was the full assignment description. the program works fine for everything except the condition in which it needs to stop immediately.
  6. Thread: sqrt function

    by kbpsu
    Replies
    16
    Views
    14,560

    got it working, thanks a lot. the final output...

    got it working, thanks a lot. the final output is


    #include <iostream>
    #include <cmath>
    using namespace std;

    double num;

    double mySquareRoot(double)
  7. Thread: sqrt function

    by kbpsu
    Replies
    16
    Views
    14,560

    buzzbuzz, i tried what you said to do, and i am...

    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)
  8. Thread: sqrt function

    by kbpsu
    Replies
    16
    Views
    14,560

    ive gotten rid of a lot of errors now with your...

    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);
    }
  9. Thread: sqrt function

    by kbpsu
    Replies
    16
    Views
    14,560

    do i put that instead of the 'double...

    do i put that instead of the 'double mysquareroot(int num)'?
  10. Thread: sqrt function

    by kbpsu
    Replies
    16
    Views
    14,560

    sqrt function

    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...
  11. Thread: simple functions

    by kbpsu
    Replies
    6
    Views
    1,669

    the only thing is that the user isnt entering...

    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...
  12. Thread: simple functions

    by kbpsu
    Replies
    6
    Views
    1,669

    what are you referring to when you say i need to...

    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...
  13. Thread: simple functions

    by kbpsu
    Replies
    6
    Views
    1,669

    simple functions

    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...
  14. Replies
    3
    Views
    4,356

    thanks edoceo for the help. i actually just...

    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>...
  15. Replies
    3
    Views
    4,356

    another do while question

    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....
  16. Thread: do.. while loops

    by kbpsu
    Replies
    19
    Views
    3,252

    thanks for the quick response. and for being...

    thanks for the quick response. and for being very helpful.
  17. Thread: do.. while loops

    by kbpsu
    Replies
    19
    Views
    3,252

    i figured out how to incorporate the switch...

    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...
  18. Thread: do.. while loops

    by kbpsu
    Replies
    19
    Views
    3,252

    ahhh, nevermind. i figured that problem out. i...

    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...
  19. Thread: do.. while loops

    by kbpsu
    Replies
    19
    Views
    3,252

    i did what you said, and it is still coming up...

    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 ==...
  20. Thread: do.. while loops

    by kbpsu
    Replies
    19
    Views
    3,252

    i tried doing something like this: #include...

    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;
  21. Thread: do.. while loops

    by kbpsu
    Replies
    19
    Views
    3,252

    youre great man. thanks a lot. there is only 1...

    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...
  22. Thread: do.. while loops

    by kbpsu
    Replies
    19
    Views
    3,252

    yeah, the user is supposed to enter the number...

    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...
  23. Thread: do.. while loops

    by kbpsu
    Replies
    19
    Views
    3,252

    i have been working on this forever. i looked in...

    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...
  24. Thread: do.. while loops

    by kbpsu
    Replies
    19
    Views
    3,252

    thanks for the quick response. i think i am on...

    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...
  25. Thread: do.. while loops

    by kbpsu
    Replies
    19
    Views
    3,252

    do.. while loops

    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...
Results 1 to 25 of 30
Page 1 of 2 1 2