Post a New Question

Computer Programming

posted by .

Project: I need help getting start on this project. What I have so far is a mess. It's Do While loops and nested loops.

Table 6.1 shows the different grads of eggs and the minimum weight required for each classification. Write a program that processes the text file EGGS.TXT containing a list of the weights of a sample of eggs. The program should report the number of eggs in each grade and the weight of the lightest and heaviest egg in the sample Figure 6.6 shows a possilbe output of the program. Note: Eggs weighting less than 1.5 ounces cannot be sold in supermarkets. * If you need more details let me know.

  • Computer Programming -

    This is a visual basics project.

  • Computer Programming -

    I suppose the table shows the minimum weight in oz. for each grade (A,B,C,.. etc.)

    This is what I suggest:
    1. Read the grade (as string) and minimum weight (as float) into two arrays. Call the number of entries maxGrade.
    2. make a third array called gradeCount, with maxGrade as the maximum subscript.
    3. Read in the weight of each egg from eggs.txt, and compare with the weight array using a for-loop. If the weight weight exceeds the array value, increment the gradeCount and exit the for-loop.
    4. repeat until the entries of eggs.txt is exhausted.
    5. output the gradeCount array with the corresponding grades.

    Post you code if you have problems.

  • Computer Programming -

    Thank you I was able to create my program with your suggestions.

Answer This Question

First Name:
School Subject:

Related Questions

More Related Questions

Post a New Question