User Profile

Collapse

Profile Sidebar

Collapse
joeyke
joeyke
Last Activity: Dec 24 '10, 02:43 PM
Joined: Feb 19 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • can someone tell me why nothing happens when I run this(codeblocks)program on my mac?

    Code:
    #include <iostream>
    #include <fstream>
    #include <string>
    #include <cctype>
    using namespace std;
    
    //function prototypes
    void initialize(int [], int);
    int readData(char [], int, int [], int);
    void printResults(char [], int, int [], int, int);
    
    //constant global variables used for arrays
    const int LIMIT = 27;
    const int ALPHA = 26;
    ...
    See more | Go to post

  • joeyke
    replied to Evaluating Expressions
    in C
    this is what i did so far but i know i'm totally off

    #include <cmath>
    #include <iostream>
    using namespace std;
    int main()
    {

    double y;

    cout<<" Enter an value for y: ";
    cin>>y;

    double check;
    check=(y>0)+((y-1) / y))+((y > 2 y / (y-1));
    cout<<" y= ";
    cin>>y;...
    See more | Go to post

    Leave a comment:


  • joeyke
    started a topic Evaluating Expressions
    in C

    Evaluating Expressions

    How do I go about writing a program that finds and prints the values of result for all even values of y from 2 to 16, using the following formula:
    result= (y-1) + (y+4)3
    y -
    1
    y

    * the 3 is power to 3
    *the denominator means y minus 1 over y, just couldn't get it to stay on the same line.
    I just don't know where to start. please help!
    See more | Go to post

  • joeyke
    replied to Quadratic equation solver
    in C
    that's what prints now after i did
    double check;
    check=(b*b)-(4*a*c);
    cout<<" posx ="<<posx<<" negx = "<<negx;
    cin>>posx, negx;
    See more | Go to post

    Leave a comment:


  • joeyke
    replied to Quadratic equation solver
    in C
    wait i get it!
    Enter the value of a: 1
    Enter the value of b: 4
    Enter the value of c: 6
    posx =-3.81582e-232 negx = 0

    is this right?
    See more | Go to post

    Leave a comment:


  • joeyke
    replied to Quadratic equation solver
    in C
    i still get this in my output:
    Enter the value of a: 1
    Enter the value of b: 2
    Enter the value of c: 3

    should there a calculation done in my output? if so then why isn't it printing that?
    See more | Go to post

    Leave a comment:


  • joeyke
    replied to Quadratic equation solver
    in C
    after i think. is it like this:

    if (check>0)
    {
    cout<<" posx ="<<posx<<" negx = "<<negx;

    cin>>posx, negx;

    posx=(-b+sqrt(check))/2*a;

    negx=(-b-sqrt(check))/2*a;


    system ("pause");

    return 0;

    }

    }
    See more | Go to post

    Leave a comment:


  • joeyke
    replied to Quadratic equation solver
    in C
    where do i put that? after this:
    posx=(-b+sqrt(check))/2*a;
    negx=(-b-sqrt(check))/2*a;
    See more | Go to post

    Leave a comment:


  • joeyke
    replied to what is wrong with line 27 and 31?
    in C
    hey

    thanks for your help ! i made the changes you suggested and they worked but i get an endless sentence repeated many times in my output. how can i just get it to print out one sentence?
    See more | Go to post

    Leave a comment:


  • joeyke
    replied to Quadratic equation solver
    in C
    yes

    oh yeah ! how do i go about that in my program? thank for you help btw!
    See more | Go to post

    Leave a comment:


  • joeyke
    replied to Quadratic equation solver
    in C
    in my output it doesn't go beyond entering a value

    i don't know how the output should look like because from what i get it shows this:
    Last login: Thu Feb 25 21:57:40 on ttys000
    /Volumes/JOANNEKEO/C++1.5/HWkeoAssignment 2-3A
    joanne-keos-macbook:~ joanne$ /Volumes/JOANNEKEO/C++1.5/HWkeoAssignment 2-3A
    Enter the value of a: 5
    Enter the value of b: 6
    Enter the value of c: 3
    joanne-keos-macbook:~...
    See more | Go to post

    Leave a comment:


  • joeyke
    started a topic Quadratic equation solver
    in C

    Quadratic equation solver

    Ask the user to enter the coefficients a, b and c. Have your program then solve the two (or possibly one) solution(s) for X. Be careful to make sure there is a solution by confirming that the square root is not executed on a negative number which is considered to be imaginary.

    Be sure to #include<cmath> and call the pow() and sqrt() functions when making your math calculations. Also note, the coefficients a b and c are to be declared...
    See more | Go to post
    Last edited by Banfa; Feb 26 '10, 09:43 AM. Reason: Added code tags

  • line 27 and line 31 have an errors but i don't know what they are

    Code:
    #include <iostream>
    
    using namespace std;
    
    int main ()
    {
        int numb1;
        int numb2;
    
    
        cout<<" enter one number: ";
        cin>>numb1;
        for (numb1=numb1+0;numb1>0;)
        {
            cout<<numb1<<" is positive";
        }
    ...
    See more | Go to post
    Last edited by Banfa; Feb 26 '10, 09:44 AM. Reason: Added code tags

    Leave a comment:


  • joeyke
    started a topic what is wrong with line 27 and 31?
    in C

    what is wrong with line 27 and 31?

    this was my task: Ask the user to enter a number, and then read in the number from the keyboard. Print out the number and also output whether the number is positive, negative or zero, and also output whether the number is even or odd.
    look at my program attached to this post. thanks!
    }
    for (numb1=numb1+0; numb1%2=0;) //line27 error:invalid lvalue in assignment
    {
    cout<<" and is positive";...
    See more | Go to post

  • How do I go about writing positive, neg, zero, and even or odd???

    Write a complete C++ program, including comments, to do the following:

    Ask the user to enter a number, and then read in the number from the keyboard. Print out the number and also output whether the number is positive, negative or zero, and also output whether the number is even or odd.
    See more | Go to post
No activity results to display
Show More
Working...