Soda - cout << teaspoonsOfSugar...

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

View Full Document Right Arrow Icon
#include <iostream> using namespace std ; int main() { double cansPerWeek = 0.0 ; cout << "How many cans of soda are consumed in a week? " ; cin >> cansPerWeek ; cout << cansPerWeek << " cans of soda per week" << endl ; double teaspoonsOfSugar = 10 * cansPerWeek ; double tablespoonsOfSugar = teaspoonsOfSugar / 3 ; double cupsOfSugar = tablespoonsOfSugar / 16 ; double ouncesOfSugar = cupsOfSugar * 10.8 ; double poundsOfSugarPerWeek = ouncesOfSugar / 16 ; double poundsOfSugarPerYear = poundsOfSugarPerWeek * 52 ;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cout &lt;&lt; teaspoonsOfSugar &lt;&lt; &quot; teaspoons of sugar per week.&quot; &lt;&lt; endl ; cout &lt;&lt; tablespoonsOfSugar &lt;&lt; &quot; tablespoons of sugar per week.&quot; &lt;&lt; endl ; cout &lt;&lt; cupsOfSugar &lt;&lt; &quot; cups of sugar per week.&quot; &lt;&lt; endl ; cout &lt;&lt; ouncesOfSugar &lt;&lt; &quot; ounces of sugar per week.&quot; &lt;&lt; endl ; cout &lt;&lt; poundsOfSugarPerWeek &lt;&lt; &quot; pounds of sugar per week.&quot; &lt;&lt; endl ; cout &lt;&lt; poundsOfSugarPerYear &lt;&lt; &quot; pounds of sugar per year. &quot; &lt;&lt; endl ; return 0 ; }...
View Full Document

Ask a homework question - tutors are online