Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help in doing this for C programming: Please look at the descrption and the notes belwo to get the right answers Sample Runs In

Need help in doing this for C programming:

Please look at the descrption and the notes belwo to get the right answers

image text in transcribed

image text in transcribed

Sample Runs

In this example, the prompt is %. Things that you type look like this. Your output should match EXACTLY.

 % c11 -Wall graph.c % ./a.out Pounds of Beans: 1 Pounds of Carrots: 2 Pounds of Lettuce: 3 Pounds of Peas: 4 Pounds of Squash: 5 Beans: B Carrots: CC Lettuce: LLL Peas: PPPP Squash: SSSSS % ./a.out Pounds of Beans: 0 Pounds of Carrots: 0 Pounds of Lettuce: 25 Pounds of Peas: 0 Pounds of Squash: 0 Beans: Carrots: Lettuce: LLLLLLLLLLLLLLLLLLLLLLLLL Peas: Squash: % ./a.out Pounds of Beans: 10 Pounds of Carrots: 0 Pounds of Lettuce: 8 Pounds of Peas: 12 Pounds of Squash: 0 Beans: BBBBBBBBBB Carrots: Lettuce: LLLLLLLL Peas: PPPPPPPPPPPP Squash: % ./a.out Pounds of Beans: 12 Pounds of Carrots: 14 Pounds of Lettuce: 10 Pounds of Peas: 8 Pounds of Squash: 6 Beans: BBBBBBBBBBBB Carrots: CCCCCCCCCCCCCC Lettuce: LLLLLLLLLL Peas: PPPPPPPP Squash: SSSSSS % 

Your output must line up properlythats the purpose of a bar graph. The following is hideous, and will be graded appropriately:

 Beans: BBB Carrots: CCC Lettuce: LLL Peas: PPP Squash: SSS 

image text in transcribed

HW2: Bar graph In this homework assignment, you will write a program called graph.c that reads numbers, representing pounds of a crop harvested, and d splays a bar graph representing those values. Simpl! Here are the crops, in alphabetical order Beans Carrots Lettuce Peas Squash Specifications Part A Part B First, prompt the user to enter five integers, representing the pounds of each crop harvested. Read them in alphabetical order, by crop name. Then, display the bar graph showing the number of pounds, in alphabetical order by crop name. The bar graph consists of the crop name, followed by repetitions ofthe nia letter of the crop name. For example, if 5 pounds of Beans were harvested, you should display BBBOB For part B you must use at least one while loop, at least one for loop, and at least one do...while loop. The loops have to be useful. An empty loop that does nothing isn't good encugh

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions

Question

Explain exothermic and endothermic reactions with examples

Answered: 1 week ago

Question

Write a short note on rancidity and corrosiveness.

Answered: 1 week ago