Question:

C++ programming help!!!!!!!!!!!!!!?

by  |  earlier

0 LIKES UnLike

ok i have an assignment where im supposed to make a program convert from U.S. Dollars ro Euros

when= 1 euro = 1.49

im a programming student and we barely started talking about C++ in class so in not an expert using it, so my program

is not working at all(Visual Studio)

THIS IS WHAT I HAVE:

Course: CS 101.

• Program: Program 1.

• Due Date: August,31,2008.

• Description: The purpuse of this progam is to be able to convert from U.S. Dollars to Euros.

• Inputs: Any dollar amount.

• Outputs: The result in Euros.

*/

#include <iostream>

using namespace std;

int main()

{

const double CONVERSION = 1.49

;int dollars;

int euros;

cout <<"Enter dollar amount without the dollar sign please: ";

cin >> dollars >> euros;

cout << endl;

cout << "Dollars = " << dollars << endl;

cout << "Euros = " << euros << endl;

cout <<"g" << endl;

return 0;

}

i NEED SOME HELP!!!!!!!! WHAT AM I MISSING IN MY CODE TO MAKE IT WORK??????????/

 Tags:

   Report

4 ANSWERS


  1. why do you input euros?. don&#039;t input euros. try this:

    euros=dollars*CONVERSION;

    cout &lt;&lt; &quot;Euros = &quot;&lt;&lt; euros &lt;&lt; endl;


  2. this will work:

    #include&lt;iostream.h&gt;

    void  main(void)

    {

    float dollars,euros;

    cout&lt;&lt;&quot;enter amount in dollars without $ sign plz\n:&quot;

    cin &gt;&gt; dollars;

    euros=dollars/1.49;     // if 1 euro=1.49 dollars

    cout&lt;&lt;dollars&lt;&lt;&quot;$=&quot;&lt;&lt;euros&lt;&lt;&quot;euros&quot;&lt;&quot;;

    }

    //please take care of syntax errors

  3. include &lt;iostream&gt;

    using namespace std;

    int main()

    {

    const double CONVERSION = 1.49

    double dollars;

    double euros;

    cout &lt;&lt;&quot;Enter dollar amount without the dollar sign please: &quot;;

    cin &gt;&gt; dollars;

    cout &lt;&lt; endl;

    euros=dollars*CONVERSION;

    cout &lt;&lt; &quot;Dollars = &quot; &lt;&lt; dollars &lt;&lt; endl;

    cout &lt;&lt; &quot;Euros = &quot; &lt;&lt; euros &lt;&lt; endl;

    cout &lt;&lt;&quot;g&quot; &lt;&lt; endl;

    return 0;

    }

    hope this helps!


  4. Before the cout line in your programe you may wirte

    euros=(int) (dollars*CONVERSION)

Question Stats

Latest activity: earlier.
This question has 4 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.