Question: dd , can someone assist with this coding assignment? Companion x How to Use the Code Editor Select the Run Code button to execute the
dd can someone assist with this coding assignment?
Companion
How to Use the Code Editor
Select the "Run Code" button to execute the program.
Select the "Calculate Grade" button to generate a score based on the completed tasks.
Continue to modify, run, and calculate your code until you are happy with the grade.
Select the "Submit" button to turn in the assignment to your instructor.
Your Tasks
In this lab, you will open a file, flowers.dat, and read input from that file in a prewritten C program. The program should read and print the names of flowers and whether they are grown in shade or sun.
Companion
Instructions
Ev Task : Write the C statements that will open the input file, flowers.dat, for reading.
Ey
Task : Write a while loop to read the input until EOF is reached. In the body of the loop, print the name of each flower and where it can be grown sun or shade
An example of the program is shown below:
Astilbe is grown in the Shade
Marigold is grown in the Sun
Begonia is grown in the Sun
Primrose is grown in the Shade
Cosmos is grown in the Sun
Dahlia is grown in the Sun
Geranium is grown in the Sun
Foxglove is grown in the Shade
Trillium is grown in the Shade
Pansy is grown in the Sun
Petunia is grown in the Sun
Daisy is grown in the Sun
Aster is grown in the Sun
Howers.cpp
G Flowers.cpp
Flowers.cpp
Data Files
Updated Nov by Julie
Open
Download
Share
Flowers. Cpp This program reads names of flowers and whether they are grown in shade or sun from an input file and prints the information to the user's screen.
Input: flowers.dat.
Output: Names of flowers and the words sun or shade.
Declare variables heneOpen input fileWite while loop that reads records from file.fin flowerName:Pnint fower name
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
