Question: In c + + String dataFileName and double onionQuantity are read from input. Open dataFileName as an output file. If the file fails to open:
In c
String dataFileName and double onionQuantity are read from input. Open dataFileName as an output file. If the file fails to open:
Use cout to output dataFileName followed by : fileopen operation failure" and a newline.
Terminate the program with as the return value without writing to the file.
Otherwise, write onionQuantity followed by "kilograms of onions" and a newline to the opened file.
Ex: If the input is note. txt then note.txt contains:
kilograms of onions
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
