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.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Physics

    1)An increase in the velocity of wire moving perpendicular through a magnetic field increases the induced EMF. true. confused me 2)There are four coils of wire being used as electromagnets. They all have the same size and are made …
  2. physics

    if you have two separate current carrying loops of wire in the xz plane, one at y=0 and one at y=L. And each loop carries a current of I in the same direction. how do you calculate the magnetic field across the y-axis, and what if …
  3. physics

    There are four coils of wire being used as electromagnets. They all have the same size and are made up of the same material but have a different number of loops. Which coil will produce a magnetic field with the maximum strength when …
  4. business

    Describe a work-related situation you feel could be improved. For example, you want to streamline the process for reimbursing employees, or you want to create a high-tech website for your small business but have no experience in programming …
  5. Finance

    Describe a work-related situation you feel could be improved. For example, you want to streamline the process for reimbursing employees, or you want to create a high-tech website for your small business but have no experience in programming …
  6. Programming Logic

    I need to create a program that has (at least) two variables, char and num. I need to use nested loops to print char, a character, in the form of the following pattern on as many lines and as many times as specified by num. For example, …
  7. Programming Logic

    I need to create a program that has (at least) two variables, char and num. I need to use nested loops to print char, a character, in the form of the following pattern on as many lines and as many times as specified by num. For example, …
  8. Programming Logic

    I need to create a flowchart/psuedocode for a dice game that give you 2 rolls with 5 dice, 3 rolls per game. the computer will roll the 4 dice and calculate your score. my question is...do i need to repeat this 3 times and can i use …
  9. Physics

    Why do roller coasters use clothoid loops instead of circular loops?
  10. Computer Science

    i Need help, using loops, visual studio 2013. write a program using loops that will calculate the following, how much would $24 deposited in a bank in 1626, have been worth at the end of this year if it had received an interest rate …

More Similar Questions