*REMINDER!*
cannot run code in devc++. U need to manually do coding on answer sheet ONLY.
Write a complete C++ program to calculate the area of a rectangle and write the answer in the .txt file. Create the .txt file using your name. The program should have the following functions: 1) main() function (16 marks) Ask the user to enter the integer value of length and width. Then, calculate the area using the user-defined function that can calculate the area based on length and width given by the user. Create the .txt file by naming that file based on your name; i.e. yourname.txt Use the if statement to check whether file creation failed. Write the message""File not created!" to print on the console if the file was not created. Use an else statement to state what to do if the file was created. Write "File created successfully!" to print on the console if the file was created. Write this statement in the yourname.txt file that you created. The length is and the width is O O The area is Apply the close() function on the object to close the file.
Write a complete C++ program to calculate the area of a rectangle and write the answer in the .txt file. Create the .txt
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Write a complete C++ program to calculate the area of a rectangle and write the answer in the .txt file. Create the .txt
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!