Question

1. Create a flow chart of the computeSales method (only) in your document. Focus on depicting...

1. Create a flow chart of the computeSales method (only) in your document. Focus on depicting how this method calculates the total sales. Use a decision diamond to model the loop and depict how the total is computed.

***Soda machine: Simulates a soda vending machine, and allows user to select a drink. Code tracks number of sodas, subtotal sales for each soda, and total sales of machine. When program first starts, there are 20 cans of each soda and $0 sales

The computeSales method is below:

private void computeSales()

        {

            double totalSales = 0.0;

           

            for (int r = 0; r <= max_row; r++)

            {                  

                totalSales += sodas[r, 2]; //sum up subtotals of sodas sold

            }

            labelTotalSales.Text = totalSales.ToString("c");

        }

Please use Visio

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Start r=0 totalSales labelTotalSales.Text r=r+1 sodas[r, 2] Stop

Add a comment
Know the answer?
Add Answer to:
1. Create a flow chart of the computeSales method (only) in your document. Focus on depicting...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT