assignment22 - choice ==...

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() { string softserve, topping, sprinkles; string choice; while( sprinkles == "") { if( softserve == "" ) cout << "Do you want chocolate, vanilla or twist?" << endl; if( topping == "") cout << "Hot fudge, chocolate or strawberry sauce?" << endl; if( sprinkles == "") cout << "Do you want sprinkles (yes/no)?" << endl; getline(cin, choice); if( choice == "yes" || choice =="no" ) sprinkles = choice; if( choice == "hot fudge" || choice =="chocolate" ||
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: choice == &quot;strawberry&quot; ) topping = choice; if( sprinkles == &quot;&quot; &amp;&amp; topping == &quot;&quot; &amp;&amp; softserve ==&quot;&quot;) if( choice == &quot;chocolate&quot; || choice ==&quot;vanilla&quot; || choice == &quot;twist&quot; ) softserve = choice; } if (sprinkles == &quot;yes&quot;) cout &lt;&lt; &quot;You ordered &quot; &lt;&lt; softserve &lt;&lt; &quot; ice cream with &quot; &lt;&lt; topping &lt;&lt; &quot; sauce and sprinkles.&quot; &lt;&lt; endl; else cout &lt;&lt; &quot;You ordered &quot; &lt;&lt; softserve &lt;&lt; &quot; ice cream with &quot; &lt;&lt; topping &lt;&lt; &quot; sauce without sprinkles.&quot; &lt;&lt; endl; cout &lt;&lt; &quot;Press a key to continue. ..&quot; &lt;&lt; endl; system(&quot;pause&gt;nul&quot;); }...
View Full Document

Ask a homework question - tutors are online