Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Opening Files and Performing File Input in Ct+ Opening Files and Performing File Input 1// Flowers.cpp - Thts progran reads nanes of flowers and uhether
Opening Files and Performing File Input in Ct+ Opening Files and Performing File Input 1// Flowers.cpp - Thts progran reads nanes of flowers and uhether they are grown in shade or sun from an tnput 2 /! file and prints the informatton to the user's screen. 3 /I Input: flowers.dat. 4 /I Output: Nanes of flowers and the words sun or shade. Summary In this lab, you open a file and read input from that file in a prewritten Ct+ program. The program should read and print the names of flowers and whether they are grown in shade or sun. The data is stored in the input file named flowers.dat. 6 #t nclude 9 using nanespace std: 10 int main) 12 Declare vartables here Instructions 14 Open tnput file 1. Ensure the source code file named Flowers.cpp is open in the code editor. 16 17// Write whtle Loop that reads records fron fr o 18 fin flowerNane, 2. Declare the variables you vill need. 3. Write the C++ statements that will open the input file flowers.dat for reading / Prtnt flower nane using the follovtng format I/cout ss var
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started