solved : where do i put my file name in this program // — t
where do i put my file name in this program // — to…where do i put my file name in this program// — to calulate students’ grades//CSIS 111- ADD YOUR SECTION NUMBER////Include statements#include #include #include #include #include using namespace std;//Global declarations: Constants and type definitions only — no variables//Function prototypesint main(){ //In cout statement below SUBSTITUTE your name and lab number cout << "Hannah Oberlin -- 111" << endl << endl; // variables declaration string fileName; string lastName; double score; double total; double grade; string description; //Program logic // prompt the user to enter the input file name cout << "Enter the input file name: "; cin >> fileName; // open the input file ifstream infile; infile.open(fileName); // exit from the program if the input file does not open if (!infile) { cout << fileName << " file cannot be opened!" << endl; exit(1); } // repeat the loop for all students in the file infile >> lastName; while (infile) { infile >> score; infile >> total; // compute the grade grade = score / total * 100; // find the grade’s description if (grade > 90) description = “Excellent”; else if (grade > 80) description = “Well Done”; else if (grade > 70) description = “Good”; else if (grade >= 60) description = “Need Improvement”; else description = “Fail”; // display the result of each student cout << lastName << " " << setprecision(0) << fixed << round(grade) << "% " << setprecision(5) << fixed << (grade * 0.01) << " " << description << endl;; infile >> lastName; } // close the input file infile.close(); //Closing program statements system(“pause”); return 0;}// Function definitionsComputer Science Engineering & Technology C Programming CSIS 111
How it works
- Paste your instructions in the instructions box. You can also attach an instructions file
- Select the writer category, deadline, education level and review the instructions
- Make a payment for the order to be assigned to a writer
- Download the paper after the writer uploads it
Will the writer plagiarize my essay?
You will get a plagiarism-free paper and you can get an originality report upon request.
Is this service safe?
All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades
LET THE PROFESSIONALS WRITE YOUR PAPER!