Question: How do I read user input line by line and store that user input into an array? In other words, storing Apples raw, 110, 50.6,

How do I read user input line by line and store that user input into an array?

In other words, storing "Apples raw, 110, 50.6, 1.2, 1.0" into a char array and that whole line is index 0. Then index 1 will be "Bananas,225, etc"

Here is the user input:

Apples raw, 110, 50.6, 1.2, 1.0

Bananas, 225, 186, 6.2, 8.2

Bread pita whole wheat, 64, 134, 14, 22.6

Broccoli raw, 91, 21.9, 2.8, 6.3

Carrots raw, 128, 46.6, 2.6, 3.3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!