All pastes #263371 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-12-01 13:48 UTC
rendered paste body
1. Problem Requirements

   -The program will display the inventory for each soda brand. Weekly
    sales and purchase records will be processed, and the final soda
    inventory will be displayed
 
2. Analyze the Problem
    
   -Inputs: inventory for each brand
            cost of each case to sell
            cost of each case to buy
 
   -Outputs: income from sales
             cost to re-stock inventory
             how much inventory is left
 
   -Limitations: a set purchase and selling price is needed per case
                        
3. Design the Algorithm 

   -Intermediate results: income from sales
                          how many cases were sold
                          how much it costs to re-stock
                          how many cases remaining

   -Two functions: instruction function and main function

   -Use a for loop for the soda type, with each soda being assigned
    a number

4. Implement the Algorithm

   -void infoFunc ()... will display information about the program
                        to the user
   -int main ()... will do the calculations of inventory
            
   -for (x = 1; x < 5; ++x)... loops the program so all sodas are used
 
   -The program will begin with a definition of global variables to
    be used.  A function will display the information to the user. Next,
    the main function will prompt the user to input a starting soda,
    and the program will loop so all sodas are covered.