sec03_aakashs_gascost

sec03_aakashs_gascost -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <iostream> #include <iomanip> using namespace std; int main () { float gallons; float price; float option; cout<<"Amount of Gas Bought"<< endl; cin>> gallons; cout<<"Press 0 If You Are Paying With Cash, Press 1 If You Are Paying With Credit
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Card&quot;&lt;&lt;endl; cin&gt;&gt;option; if (option==1) { price= 3.021*gallons; } else price= 3.121*gallons; cout&lt;&lt;&quot;You will pay: $ &quot;&lt;&lt; setprecision(2) &lt;&lt; fixed &lt;&lt; price&lt;&lt; endl; return 0; } /*Collarborating with Shiv Desai and Cameron DeAngeles*/...
View Full Document

Ask a homework question - tutors are online