Question: C + + Programming Process Schedule Please Assist Instructions: I need the code changed to be an input txt file ( use notepad ) rather

C++ Programming
Process Schedule Please Assist
Instructions: I need the code changed to be an input txt file (use notepad) rather than cin input format like below. Please input 1.)BSIZE 3096 KB,2.) START 0 ms,3.)CORE 100 ms of CPU Time, 4.)READ 256B (SSD),5.)CORE 20 ms,6.)DISPLAY50 ms,7.)CORE 20 ms,8.)INPUT 800 ms,9.) CORE 10 ms,10.)WRITE 128 B (SSD)11.)CORE 30 ms,12.)NEW 100 ms,13.)CORE 20 ms.
The inputs above are in correct order. Their values are mentioned above as well. Please have the txt file able to be uploaded so the program's steps (mentioned above) will be used sequentially.
Each step should have READY, RUNNING, BLCOKED, or TERMINATED if the step is READY to take the value from the text file, is RUNNING the value from the text file, BLOCKED if the value is not being taken from the text file, or is TERMINATED because the value is unable to be taken from the text file.
Program so far:
#include
#include
using namespace std;
struct Process {
int b_size;
int start_time;
int core_time;
int core_time2;
int core_time3;
int core_time4;
int core_time5;
int read_size; //Is read measured in size or time? //Also is the unit B bytes or does it stand for something else?
int input_time; //ask a tutor if they want a sleep function rather than an input of 900 ms
int display_time;
int write_size;
};
int main(){
// Input values
Process process;
cout << "Enter b size (KB): ";
cin >> process.b_size; //4096 KB
cout << "Enter start time (ms): ";
cin >> process.start_time; //0 ms
cout << "Enter core time (ms): ";
cin >> process.core_time; //200 ms
cout << "Enter read size (B): ";
cin >> process.read_size; //256 B
cout << "Enter core time (ms): ";
cin >> process.core_time2; //30 ms
cout << "Enter display time (ms): ";
cin >> process.display_time; //100 ms
cout << "Enter core time (ms): ";
cin >> process.core_time3; //10 ms
cout << "Enter input time (ms): ";
cin >> process.input_time; //900 ms
cout << "Enter core time (ms): ";
cin >> process.core_time4; //10ms
cout << "Enter write size (in bytes): ";
cin >> process.write_size; //256 bytes
cout << "Enter core time (ms): ";
cin >> process.core_time5; //30 ms
// Displaying entered process information
cout << "Process Information:
";
cout << "Block Size: "<< process.b_size <<" KB
";
cout << "Start Time: "<< process.start_time <<" ms
";
cout << "Core Time: "<< process.core_time <<" ms
";
cout << "Read: "<< process.read_size <<" B
";
cout << "Core Time: "<< process.core_time2<<" ms
";
cout << "Display Time: "<< process.display_time <<" ms
";
cout << "Core Time: "<< process.core_time3<<" ms
";
cout << "Input Time: "<< process.input_time <<" ms
";
cout << "Core Time: "<< process.core_time4<<" ms
";
cout << "Write Size: "<< process.write_size <<" bytes
";
cout << "Core Time: "<< process.core_time5<<" ms
";
cout <<"**************************************************************************";
//New process information
//Think of this as a part two of the process scheduling or think of it like a break in a program?
int new_process_start_time;
int new_process_core_time; //The 6th core time (reading)
cout <<"
Enter new process start time (ms): ";
cin >> new_process_start_time;
cout <<"
Enter new process core time (ms): ";
cin >> new_process_core_time;
//Displaying new process information
cout <<"
New Process Information: ";
cout <<"
Start Time: "<< new_process_start_time <<" ms";
cout <<"
Core Time: "<< new_process_core_time <<" ms";
cout << endl << endl;
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!