Instruction:
1. Please read the two articles. (Kincheloe part 1 & 2)
2. Please choose some of the topics covered in each chapter, provide a brief summary (2-3 sentences) of those topics.
3. Then add your reflections, insights, or relevant experiences, etc. to help illustrate or expand upon the course.
4. This journal should be at least 400 words.
p5-start.cppp5-start.cpp/**
* @author Jane Student
* @cwid 123 45 678
* @class CSci 430, Spring 2018
* @ide Visual Studio Express 2010
* @date November 15, 2018
* @assg prog-04
*
* @description This program implements a simulation of process
* scheduling policies. In this program, we implement round-robin
* scheduling, where the time slice quantum can be specified as
* as a command line parameter. And we also implement shortest
* remaining time (SRT) scheduling policy
*/
#include<stdlib.h>
#include<iostream>
#include<iomanip>
#include<fstream>
#include<string>
#include<list>
usingnamespace std;
// global constants
// I won't test your round robin implementation with more than 20 processes
constint MAX_PROCESSES =20;
constint NO_PROCESS =0;
// Simple structure, holds all of the information about processes, their names
// arrival and service times, that we are to simulate.
typedefstruct
{
string processName;
int arrivalTime;
int serviceTime;
// holds running count of time slices for current time quantum, when
// serviceTime == quantum, time slice is up
int sliceTime;
// holds total number of time steps currently run, when == to
// serviceTime process is done
int totalTime;
// holds time when process finishes, used to calculate final stats,
// like T_r, T_r/T_s
int finishTime;
// a boolean flag, we will set this to true when the process is complete
bool finished;
}Process;
// Process table, holds table of information about processes we are simulating
typedefstruct
{
int numProcesses;
Process* process[MAX_PROCESSES];
}ProcessTable;
/** Create process table
* Allocate memory for a new process table. Load the process
* information from the simulation file into a table with the process
* information needed to perform the simulation. At the same time we
* initialize other information in process table for use in the
* simulation. Return the newly created ProcessTable
*
* @param processFilanem The name (char*) of the file to open and read
* the process information from.
* @param processTable This is actually a return parameter. This
* should be a pointer to an already allocated array of
* Process structure items. We will fill in this structure
* and return the process information.
*
* @returns ProcessTable* The newly allocated and initialized ProcessTable
* structure.
*/
ProcessTable* createProcessTable(char* processFilename)
{
ifstream simprocessfile(processFilename);
ProcessTable* processTable;
int pid;
string processName;
int arrivalTime;
int serviceTime;
// If we can't open file, abort and let ...
prog-05.pdfProgramming Assignment #5CSci 430, Spring 2.docxstilliegeorgiana
prog-05.pdf
Programming Assignment #5
CSci 430, Spring 2019
Dates:
Assigned: Monday April 15, 2019
Due: Wednesday May 1, 2019 (before Midnight)
Objectives:
� Understand short-term process scheduling.
� Work with data structures to implement a round-robin scheduler.
� Look at e�ects of di�erent time slice quantum sizes on the round-robin scheduling algorithm.
� Use C/C++ to implement vector and matrix data structures, get practice in creating and using
such data structures in C/C++.
Description:
Our textbooks chapter 9 discusses several possible short-term process scheduling policies. In this
programming assignment exercise we will implement two of the preemptive policies, the simple shortest
remaining time policy (SRT) and the round-robin scheduler with preemptive time slicing. Your program
will be given a simple input �le, indicating the process name, its arrival time and its total service time,
the same as the process scheduling examples from our textbook in Table 9.4 and Figure 9.5. You will
simulate the execution of the required schedulers. As in previous assignments, you program will need
to work non-interactively and be callable from the command line. The program will be provided with
the �le name of a �le with process information, in the format discussed below. Your program will also
be given the time slicing quantum parameter it is to use for the simulation, if round-robin scheduling
is selected. Your program will need to output the results of running the set of simulated processes
using the selected scheduling policy with the indicated time slice for the round-robin scheduler. Your
program will have to output its results exactly as shown below in the required output format. Your
program will also need to calculate some summary statistics for the simulated processes, including the
turnaround time and Tr/Ts ratio for each process, and the mean Tr and Tr/Ts values for the given
simulation.
Process simulation �le formats
The �les with the information about the processes to be simulated are fairly simple, and have the same
information that our textbook uses to illustrate the process scheduling examples. Each simulation �le
contains multiple rows of data, where each row consists of the process name, its arrival time, and its
service time. Here is an example:
1
A 0 3
B 2 6
C 4 4
D 6 5
E 8 2
This �le is named process-01.sim in the zip archive of �les I have given you to get started on this
assignment. This is also the same set of processes and start/service times used for all of the examples
in table 9.4 and �gure 9.5.
Running Simulations
As with previous assignments you are required to support using your simulation from the command
line. Your program will take the name of the �le containing the process information �rst. The next
parameter will be either 'rr' to perform round-robin scheduling, or 'srt' if shortest remaining time policy
is to be simulated. Finally, a 3rd parameter will be supplied for the round-robin ...
#define ENABLE_COMMANDER
#define ENABLE_REPORTER
#include <cctype> // for toupper()
#include <cstdlib> // for EXIT_SUCCESS and EXIT_FAILURE
#include <cstring> // for strerror()
#include <cerrno> // for errno
#include <deque> // for deque (used for ready and blocked queues)
#include <fstream> // for ifstream (used for reading simulated process programs)
#include <iostream> // for cout, endl, and cin
#include <sstream> // for stringstream (for parsing simulated process programs)
#include <sys/wait.h> // for wait()
#include <unistd.h> // for pipe(), read(), write(), close(), fork(), and _exit()
#include <vector> // for vector (used for PCB table)
using namespace std;
class Instruction {
public:
char operation;
int intArg;
string stringArg;
};
class Cpu {
public:
vector<Instruction> *pProgram;
int programCounter;
int value;
int timeSlice;
int timeSliceUsed;
};
enum State {
STATE_READY,
STATE_RUNNING,
STATE_BLOCKED,
STATE_END
};
class PcbEntry {
public:
int processId;
int parentProcessId;
vector<Instruction> program;
unsigned int programCounter;
int value;
unsigned int priority;
State state;
unsigned int startTime;
unsigned int timeUsed;
};
// The number of valid priorities.
#define NUM_PRIORITIES 4
// An array that maps priorities to their allotted time slices.
static const unsigned int PRIORITY_TIME_SLICES[NUM_PRIORITIES] = {
1,
2,
4,
8
};
unsigned int timestamp = 0;
Cpu cpu;
// For the states below, -1 indicates empty (since it is an invalid index).
int runningState = -1; // The index of the running process in the PCB table.
// readyStates is an array of queues. Each queue holds PCB indices for ready processes
// of a particular priority.
deque<int> readyStates[NUM_PRIORITIES];
deque<int> blockedState; // A queue fo PCB indices for blocked processes.
deque<int> deadState;
// In this implementation, we'll never explicitly clear PCB entries and the
// index in the table will always be the process ID. These choices waste memory,
// but since this program is just a simulation it the easiest approach.
// Additionally, debugging is simpler since table slots and process IDs are
// never re-used.
vector<PcbEntry *> pcbTable;
double cumulativeTimeDiff = 0;
int numTerminatedProcesses = 0;
// Sadly, C++ has no built-in way to trim strings:
string &trim(string &argument)
{
string whitespace(" \t\n\v\f\r");
size_t found = argument.find_last_not_of(whitespace);
if (found != string::npos) {
argument.erase(found + 1);
argument.erase(0, argument.find_first_not_of(whitespace));
} else {
argument.clear(); // all whitespace
}
return argument;
}
bool createProgram(const string &filename, vector<Instruction> &program)
{
ifstream file;
int lineNum = 0;
program.clear();
file.open(filename.c_str());
if (!file.is_open()) {
cout << "Error opening file " << filename << ...
Lab Assignment 4 CSE330 Spring 2014 Skeleton Code for ex.docxMARRY7
/* Lab Assignment 4 CSE330 Spring 2014 */
/* Skeleton Code for ex0 of lab4 */
/* No code will be provided for ex1 of lab4 */
#include <stdio.h> /* for NULL */
#include <ctype.h> /* for atoi() */
#include <errno.h> /* for perror() */
#include <signal.h> /* for sigvec() etc. */
#include <sys/types.h> /* for <arpa/inet.h> */
#include <sys/socket.h> /* for PF_INET, etc. */
#include <netinet/in.h> /* for struct sockaddr_in */
#include <arpa/inet.h> /* for inet_addr() */
#include <sys/time.h>
#include "lab4.h"
/* this is in netinet/in.h; included here for reference only.
struct sockaddr_in {
short sin_family;
u_short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
*/
/***************************************************************************/
#define LINESIZE 80
#define TYPE0TIMEOUT 3
#define TYPE1TIMEOUT 30
/* You should give a long timeout, like 30sec, otherwise */
/* duplicated responses from the server may cause some problem */
#define MAXRETRY 3
/***************************************************************************/
static char *RCSId="$Id: client2.c,v 4 2014/04/20 03:15:07 cse3300 Exp $";
/***************************************************************************/
/* some functions you may find useful if you implement them */
extern int stringToAddress(char *s, struct sockaddr_in *a);
extern int msgok(LABMSG *);
extern u_short msgchecksum(u_short *);
extern void alarmCatcher(void);
extern int tries; /* for retransmission routines */
int numtries;
/***** this will die ****/
FILE *logFile;
void die(char *s)
{
perror(s);
exit(2);
}
void startTimer(int secs)
{
alarm(secs);
}
void stopTimer(void)
{
alarm(0);
}
/* should change it by yourself if needed!!! */
void printResponse(LABMSG *mp, int ck)
{
int type;
mp->courseEtc = ntohs(mp->courseEtc);
type = ( (mp->courseEtc & MESSAGETYPE) !=0)?1:0;
printf("course=%d, Type=%d\n", mp->courseEtc&0x3fff,type);
if (ntohl(mp->cookie) != ck)
printf("Cookies don't match: sent %x received %x\n",mp->cookie,ck);
if (mp->courseEtc & REQRESP)
printf("response ");
else {
printf("request??\n");
return;
}
mp->result = ntohs(mp->result);
/*printf(" result = %x: ",mp->result);*/
if (mp->result&TRANSOUTCOME) { /* Check outcome */
printf("error: ");
switch (mp->result & 0x7fff) {
case ERROR_CHECKSUM:
printf("checksum failure\n");
break;
case ERROR_SYNTAX:
printf("syntax error\n");
break;
case ERROR_UNKSSN:
printf("unknown SSN %d\n", ntohl(mp->reqSSN) );
break;
case ERROR_SERVER:
printf("Unspecified Server Error\n");
default:
printf("Unknown Error.\n");
} /* case switch */
} else { /* successful transaction */
if(type)printf("Test succeeded.");
if (!type) /* Type 0 -- print SSN and Response */
printf(": %d -> %d\n", ntohl(mp->reqSSN), mp->result&0x7fff);
else
printf("\n"); /* XXX print number of responses */
}
}
/*-----------------------------------*/
/* added by ZXC:
this fun ...
Assignment 13/assg-13.cppAssignment 13/assg-13.cpp/**
* @author Jane Programmer
* @cwid 123 45 678
* @class COSC 2336, Spring 2019
* @ide Visual Studio Community 2017
* @date April 8, 2019
* @assg Assignment 13
*
* @description Assignment 13 Dictionaries and Hash table
* implementations.
*/
#include<cassert>
#include<iostream>
#include"KeyValuePair.hpp"
#include"Employee.hpp"
#include"HashDictionary.hpp"
usingnamespace std;
/** main
* The main entry point for this program. Execution of this program
* will begin with this main function.
*
* @param argc The command line argument count which is the number of
* command line arguments provided by user when they started
* the program.
* @param argv The command line arguments, an array of character
* arrays.
*
* @returns An int value indicating program exit status. Usually 0
* is returned to indicate normal exit and a non-zero value
* is returned to indicate an error condition.
*/
int main(int argc,char** argv)
{
// -----------------------------------------------------------------------
cout <<"----- testing Employee record and KeyValuePair class -----------"<< endl;
KeyValuePair<int, string> pair(42,"blue");
cout <<"test key: "<< pair.key()<< endl;
assert(pair.key()==42);
cout <<"test value: "<< pair.value()<< endl;
assert(pair.value()=="blue");
int id =3;
Employee e(id,"Derek Harter","1234 Main Street, Commerce TX",12345.67);
cout << e << endl;
assert(e.getId()==3);
assert(e.getName()=="Derek Harter");
cout << endl;
// -----------------------------------------------------------------------
cout <<"-------------- testing quadratic probing -----------------------"<< endl;
constint TABLE_SIZE =7;
HashDictionary<int,Employee> dict(TABLE_SIZE, EMPTY_EMPLOYEE_ID);
cout <<"Newly created hash dictionary should be empty, size: "<< dict.size()<< endl;
assert(dict.size()==0);
int probeIndex =0;
//cout << "probe index: " << probeIndex
// << " returned probe value: " << dict.probe(id, probeIndex)
// << endl;
//assert(dict.probe(id, probeIndex) == 2);
probeIndex =1;
//cout << "probe index: " << probeIndex
// << " returned probe value: " << dict.probe(id, probeIndex)
// << endl;
//assert(dict.probe(id, probeIndex) == 5);
probeIndex =5;
//cout << "probe index: " << probeIndex
// << " returned probe value: " << dict.probe(id, probeIndex)
// << endl;
//assert(dict.probe(id, probeIndex) == 37);
cout << endl;
// -----------------------------------------------------------------------
cout <<"-------------- testing mid-square hashing ----------------------"<< endl;
// the following asserts will only work for 32 bit ints, leave asserts
// commented out if you have 64 bit asserts
cout <<"Assuming 32 bit (4 byte) ints for these tests: "<<sizeof(int)<< endl;
assert(sizeof(int)==4);
//id = 3918;
//cout << "hash key: " << id
// << " returned hash value: " << dict.hash(id)
// << endl; ...
prog-05.pdfProgramming Assignment #5CSci 430, Spring 2.docxstilliegeorgiana
prog-05.pdf
Programming Assignment #5
CSci 430, Spring 2019
Dates:
Assigned: Monday April 15, 2019
Due: Wednesday May 1, 2019 (before Midnight)
Objectives:
� Understand short-term process scheduling.
� Work with data structures to implement a round-robin scheduler.
� Look at e�ects of di�erent time slice quantum sizes on the round-robin scheduling algorithm.
� Use C/C++ to implement vector and matrix data structures, get practice in creating and using
such data structures in C/C++.
Description:
Our textbooks chapter 9 discusses several possible short-term process scheduling policies. In this
programming assignment exercise we will implement two of the preemptive policies, the simple shortest
remaining time policy (SRT) and the round-robin scheduler with preemptive time slicing. Your program
will be given a simple input �le, indicating the process name, its arrival time and its total service time,
the same as the process scheduling examples from our textbook in Table 9.4 and Figure 9.5. You will
simulate the execution of the required schedulers. As in previous assignments, you program will need
to work non-interactively and be callable from the command line. The program will be provided with
the �le name of a �le with process information, in the format discussed below. Your program will also
be given the time slicing quantum parameter it is to use for the simulation, if round-robin scheduling
is selected. Your program will need to output the results of running the set of simulated processes
using the selected scheduling policy with the indicated time slice for the round-robin scheduler. Your
program will have to output its results exactly as shown below in the required output format. Your
program will also need to calculate some summary statistics for the simulated processes, including the
turnaround time and Tr/Ts ratio for each process, and the mean Tr and Tr/Ts values for the given
simulation.
Process simulation �le formats
The �les with the information about the processes to be simulated are fairly simple, and have the same
information that our textbook uses to illustrate the process scheduling examples. Each simulation �le
contains multiple rows of data, where each row consists of the process name, its arrival time, and its
service time. Here is an example:
1
A 0 3
B 2 6
C 4 4
D 6 5
E 8 2
This �le is named process-01.sim in the zip archive of �les I have given you to get started on this
assignment. This is also the same set of processes and start/service times used for all of the examples
in table 9.4 and �gure 9.5.
Running Simulations
As with previous assignments you are required to support using your simulation from the command
line. Your program will take the name of the �le containing the process information �rst. The next
parameter will be either 'rr' to perform round-robin scheduling, or 'srt' if shortest remaining time policy
is to be simulated. Finally, a 3rd parameter will be supplied for the round-robin ...
#define ENABLE_COMMANDER
#define ENABLE_REPORTER
#include <cctype> // for toupper()
#include <cstdlib> // for EXIT_SUCCESS and EXIT_FAILURE
#include <cstring> // for strerror()
#include <cerrno> // for errno
#include <deque> // for deque (used for ready and blocked queues)
#include <fstream> // for ifstream (used for reading simulated process programs)
#include <iostream> // for cout, endl, and cin
#include <sstream> // for stringstream (for parsing simulated process programs)
#include <sys/wait.h> // for wait()
#include <unistd.h> // for pipe(), read(), write(), close(), fork(), and _exit()
#include <vector> // for vector (used for PCB table)
using namespace std;
class Instruction {
public:
char operation;
int intArg;
string stringArg;
};
class Cpu {
public:
vector<Instruction> *pProgram;
int programCounter;
int value;
int timeSlice;
int timeSliceUsed;
};
enum State {
STATE_READY,
STATE_RUNNING,
STATE_BLOCKED,
STATE_END
};
class PcbEntry {
public:
int processId;
int parentProcessId;
vector<Instruction> program;
unsigned int programCounter;
int value;
unsigned int priority;
State state;
unsigned int startTime;
unsigned int timeUsed;
};
// The number of valid priorities.
#define NUM_PRIORITIES 4
// An array that maps priorities to their allotted time slices.
static const unsigned int PRIORITY_TIME_SLICES[NUM_PRIORITIES] = {
1,
2,
4,
8
};
unsigned int timestamp = 0;
Cpu cpu;
// For the states below, -1 indicates empty (since it is an invalid index).
int runningState = -1; // The index of the running process in the PCB table.
// readyStates is an array of queues. Each queue holds PCB indices for ready processes
// of a particular priority.
deque<int> readyStates[NUM_PRIORITIES];
deque<int> blockedState; // A queue fo PCB indices for blocked processes.
deque<int> deadState;
// In this implementation, we'll never explicitly clear PCB entries and the
// index in the table will always be the process ID. These choices waste memory,
// but since this program is just a simulation it the easiest approach.
// Additionally, debugging is simpler since table slots and process IDs are
// never re-used.
vector<PcbEntry *> pcbTable;
double cumulativeTimeDiff = 0;
int numTerminatedProcesses = 0;
// Sadly, C++ has no built-in way to trim strings:
string &trim(string &argument)
{
string whitespace(" \t\n\v\f\r");
size_t found = argument.find_last_not_of(whitespace);
if (found != string::npos) {
argument.erase(found + 1);
argument.erase(0, argument.find_first_not_of(whitespace));
} else {
argument.clear(); // all whitespace
}
return argument;
}
bool createProgram(const string &filename, vector<Instruction> &program)
{
ifstream file;
int lineNum = 0;
program.clear();
file.open(filename.c_str());
if (!file.is_open()) {
cout << "Error opening file " << filename << ...
Lab Assignment 4 CSE330 Spring 2014 Skeleton Code for ex.docxMARRY7
/* Lab Assignment 4 CSE330 Spring 2014 */
/* Skeleton Code for ex0 of lab4 */
/* No code will be provided for ex1 of lab4 */
#include <stdio.h> /* for NULL */
#include <ctype.h> /* for atoi() */
#include <errno.h> /* for perror() */
#include <signal.h> /* for sigvec() etc. */
#include <sys/types.h> /* for <arpa/inet.h> */
#include <sys/socket.h> /* for PF_INET, etc. */
#include <netinet/in.h> /* for struct sockaddr_in */
#include <arpa/inet.h> /* for inet_addr() */
#include <sys/time.h>
#include "lab4.h"
/* this is in netinet/in.h; included here for reference only.
struct sockaddr_in {
short sin_family;
u_short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
*/
/***************************************************************************/
#define LINESIZE 80
#define TYPE0TIMEOUT 3
#define TYPE1TIMEOUT 30
/* You should give a long timeout, like 30sec, otherwise */
/* duplicated responses from the server may cause some problem */
#define MAXRETRY 3
/***************************************************************************/
static char *RCSId="$Id: client2.c,v 4 2014/04/20 03:15:07 cse3300 Exp $";
/***************************************************************************/
/* some functions you may find useful if you implement them */
extern int stringToAddress(char *s, struct sockaddr_in *a);
extern int msgok(LABMSG *);
extern u_short msgchecksum(u_short *);
extern void alarmCatcher(void);
extern int tries; /* for retransmission routines */
int numtries;
/***** this will die ****/
FILE *logFile;
void die(char *s)
{
perror(s);
exit(2);
}
void startTimer(int secs)
{
alarm(secs);
}
void stopTimer(void)
{
alarm(0);
}
/* should change it by yourself if needed!!! */
void printResponse(LABMSG *mp, int ck)
{
int type;
mp->courseEtc = ntohs(mp->courseEtc);
type = ( (mp->courseEtc & MESSAGETYPE) !=0)?1:0;
printf("course=%d, Type=%d\n", mp->courseEtc&0x3fff,type);
if (ntohl(mp->cookie) != ck)
printf("Cookies don't match: sent %x received %x\n",mp->cookie,ck);
if (mp->courseEtc & REQRESP)
printf("response ");
else {
printf("request??\n");
return;
}
mp->result = ntohs(mp->result);
/*printf(" result = %x: ",mp->result);*/
if (mp->result&TRANSOUTCOME) { /* Check outcome */
printf("error: ");
switch (mp->result & 0x7fff) {
case ERROR_CHECKSUM:
printf("checksum failure\n");
break;
case ERROR_SYNTAX:
printf("syntax error\n");
break;
case ERROR_UNKSSN:
printf("unknown SSN %d\n", ntohl(mp->reqSSN) );
break;
case ERROR_SERVER:
printf("Unspecified Server Error\n");
default:
printf("Unknown Error.\n");
} /* case switch */
} else { /* successful transaction */
if(type)printf("Test succeeded.");
if (!type) /* Type 0 -- print SSN and Response */
printf(": %d -> %d\n", ntohl(mp->reqSSN), mp->result&0x7fff);
else
printf("\n"); /* XXX print number of responses */
}
}
/*-----------------------------------*/
/* added by ZXC:
this fun ...
Assignment 13/assg-13.cppAssignment 13/assg-13.cpp/**
* @author Jane Programmer
* @cwid 123 45 678
* @class COSC 2336, Spring 2019
* @ide Visual Studio Community 2017
* @date April 8, 2019
* @assg Assignment 13
*
* @description Assignment 13 Dictionaries and Hash table
* implementations.
*/
#include<cassert>
#include<iostream>
#include"KeyValuePair.hpp"
#include"Employee.hpp"
#include"HashDictionary.hpp"
usingnamespace std;
/** main
* The main entry point for this program. Execution of this program
* will begin with this main function.
*
* @param argc The command line argument count which is the number of
* command line arguments provided by user when they started
* the program.
* @param argv The command line arguments, an array of character
* arrays.
*
* @returns An int value indicating program exit status. Usually 0
* is returned to indicate normal exit and a non-zero value
* is returned to indicate an error condition.
*/
int main(int argc,char** argv)
{
// -----------------------------------------------------------------------
cout <<"----- testing Employee record and KeyValuePair class -----------"<< endl;
KeyValuePair<int, string> pair(42,"blue");
cout <<"test key: "<< pair.key()<< endl;
assert(pair.key()==42);
cout <<"test value: "<< pair.value()<< endl;
assert(pair.value()=="blue");
int id =3;
Employee e(id,"Derek Harter","1234 Main Street, Commerce TX",12345.67);
cout << e << endl;
assert(e.getId()==3);
assert(e.getName()=="Derek Harter");
cout << endl;
// -----------------------------------------------------------------------
cout <<"-------------- testing quadratic probing -----------------------"<< endl;
constint TABLE_SIZE =7;
HashDictionary<int,Employee> dict(TABLE_SIZE, EMPTY_EMPLOYEE_ID);
cout <<"Newly created hash dictionary should be empty, size: "<< dict.size()<< endl;
assert(dict.size()==0);
int probeIndex =0;
//cout << "probe index: " << probeIndex
// << " returned probe value: " << dict.probe(id, probeIndex)
// << endl;
//assert(dict.probe(id, probeIndex) == 2);
probeIndex =1;
//cout << "probe index: " << probeIndex
// << " returned probe value: " << dict.probe(id, probeIndex)
// << endl;
//assert(dict.probe(id, probeIndex) == 5);
probeIndex =5;
//cout << "probe index: " << probeIndex
// << " returned probe value: " << dict.probe(id, probeIndex)
// << endl;
//assert(dict.probe(id, probeIndex) == 37);
cout << endl;
// -----------------------------------------------------------------------
cout <<"-------------- testing mid-square hashing ----------------------"<< endl;
// the following asserts will only work for 32 bit ints, leave asserts
// commented out if you have 64 bit asserts
cout <<"Assuming 32 bit (4 byte) ints for these tests: "<<sizeof(int)<< endl;
assert(sizeof(int)==4);
//id = 3918;
//cout << "hash key: " << id
// << " returned hash value: " << dict.hash(id)
// << endl; ...
It seemed that long forum debates about methods of measuring algorithm's running time, functions to use and precision that should be expected were over. Unfortunately, we have to return to this question once again. Today we will discuss the question how we should measure speed of a parallel algorithm.
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdfssuser6254411
Programming For Big Data [ Submission: DvcScheduleV2.cpp and StaticArray.h and/or
DynamicArray.h ]
Assignment 5's runtime was too slow -- a couple of minutes or so. It's because of the duplicate-
checking, with over 4 billion compares.
Rewrite the duplicate-checking logic from Assignment 5, using a technique from "Techniques
For Big Data, Reading" to do fewer compares (check the term first then section number for the
duplicate check), and come up with the exact same results as Assignment 5.
You may use your StaticArray.h from Assignment 3 and/or your DynamicArray.h from
assignments 4, but you may not use any STL containers. Submit the H file(s) you use in your
solution, even if there are no changes since your previous work. Your project will be compiled
for grading using the default stack memory size of 1MB.
Since this version is supposed to be fast, there is no longer a need for a progress bar. Include one
if you wish (you may see the run time dramatically changed), or you may leave it out -- your
choice. But if you do have a progress bar, do remember to "flush"...
[Submission] - Submit the driver program (DvcScheduleV2.cpp) with the header files used
The code I wrote for previous assignment:
Main:
#include
#include
#include
#include
#include "DynamicArray.h"
using namespace std;
struct Class
{
string code;
int count;
};
int main()
{
DynamicArray sub;
DynamicArray sem;
DynamicArray sec;
int totalSubjects = 0;
int dup = 0;
int total = 0;
int counter = 0;
bool duplicate;
bool stored;
// For parsing input file
char* token;
char buf[1000];
const char* const tab = "\t";
// Open input file
ifstream fin;
fin.open("dvc-schedule.txt");
if (!fin.good())
{
cout << "I/O error. File can't be found!\n";
return 1; // Exit the program with an error code
}
// Read the input file
while (fin.good())
{
// Progress bar
if (counter % 1000 == 0)
{
cout << '.';
cout.flush();
}
duplicate = false;
stored = false;
string line;
getline(fin, line);
total++; // Total lines processed
strcpy(buf, line.c_str());
if (buf[0] == 0)
continue; // Skip blank lines
// Parse the line
const string term(token = strtok(buf, tab));
const string section(token = strtok(0, tab));
const string course((token = strtok(0, tab)) ? token : "");
const string instructor((token = strtok(0, tab)) ? token : "");
const string whenWhere((token = strtok(0, tab)) ? token : "");
if (course.find('-') == string::npos)
continue;
const string code(course.begin(), course.begin() + course.find('-'));
// Check for duplicates
for (int i = 0; i < counter; i++)
{
if (sem[i] == term && sec[i] == section)
{
dup++;
duplicate = true;
break;
}
}
if (duplicate == true)
continue;
sem[counter] = term;
sec[counter] = section;
counter++;
for (int i = 0; i < totalSubjects; i++)
{
if (sub[i].code == code)
{
sub[i].count++;
stored = true;
break;
}
}
if (stored == true)
continue;
Class y;
y.code = code;
y.count = 1;
sub[totalSubjects] = y;
totalSubjects++;
}
fin.close();
cout << endl;
for (int i = 0; i < totalSubjects; i++)
{
f.
Need help implementing the skeleton code below, I have provided the .pdfezzi552
I need help with this practice problem?
Execute the following coding segment and identify the errors in the program. Debug the program
and provide the correct version of the code. Hinclude int main() printf(\"%s\", isdigit(\'A\') ? \"A
is digit\" \"A is not digit\"); a : a printf(\"Inlnln\") return return e;
Solution
in range [0,9]. If it\'s not then this function returns 0.
Given program compiles successfully, compiler does not give any error.
But If the input of isdigit(\'A\') is changed then the program will always print
\"A is a digit\" or
\"A is not a digit\" .
It will not print exact value of char A.
So, correct code is given below.
#include
int main()
{
char A = \'1\';
printf(\"%c%s\",A,isdigit(A)? \" is a digit\" : \" is not a digit\");
printf(\"\ \");
A = \'B\';
printf(\"%c%s\",A,isdigit(A)? \" is a digit\" : \" is not a digit\");
printf(\"\ \");
return 0;
}
Sample Output:
1 is a digit
B is not a digit.
Video games are written as a main loop: process player input, update the state of the game, render a new frame to the screen, repeat. They do this 60 times a second, with millisecond timing. Most monitoring tools are also written as loops: send a probe, wait for the response, update a data store, sleep. Often this is done pretty slowly, maybe once a second! In video games if you can’t update fast enough, you skip the rendering step and the frame rate drops. With monitoring tools if your loop takes to long you also stop logging data as often, and instead of choppy gameplay you get gaps in your graphs, often when you need that data the most!
Let’s use ping as an example and see how we can rewrite its main loop to function more like a video game, keeping a high frame rate.
Adam Sitnik "State of the .NET Performance"Yulia Tsisyk
MSK DOT NET #5
2016-12-07
In this talk Adam will describe how latest changes in.NET are affecting performance.
Adam wants to go through:
C# 7: ref locals and ref returns, ValueTuples.
.NET Core: Spans, Buffers, ValueTasks
And how all of these things help build zero-copy streams aka Channels/Pipelines which are going to be a game changer in the next year.
Here is the code- I can't get it to work- I need a function that finds.pdfdoshirajesh75
Here is the code: I can't get it to work. I need a function that finds the maximum of two integers.
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
/* declare global variables including a table structure to hold scheduling
information */
/* optional: define a function that finds the maximum of two integers */
int total_processes = 0;
struct node{
int id;
int arrival;
int total_cycles;
int total_remaining;
int done;
int start;
int already_started;
int end;
int turnaround;
}* table = NULL;
typedef struct node table_type;
/***************************************************************/
void print_table() {
/*
1.declare local variables
2. print table header
3. for each process
4. print the contents (id, arrival time, total_cycles) of
each field of the table's index
5. if process has been scheduled ("done" field is 1,
6. print other contents (start time, end time, turnaround time)
*/
printf("ID/tArrival/tTotal/tStart/tEnd/tTurnaround/n");
printf("--------------------------------------------\n");
int i;
for(i=0; i < total_processes; i++){
printf("%d\t", table[i].id);
printf("%d\t", table[i].arrival);
printf("%d\t", table[i].total_cycles);
printf("%d\t", table[i].start);
printf("%d\t", table[i].end);
printf("%d\t", table[i].turnaround);
}
return;
}
/***************************************************************/
void procedure_1() {
/*"PROCEDURE FOR OPTION #1"
/* declare local variables */
/* prompt for total number of processes */
/* allocate memory for table to hold process parameters */
/* for each process */
/* prompt for process id, arrival time, and total cycle
time */
/* print contents of table */
int i;
printf("Enter total number of processes: ");
scanf("%d", &table[i].arrival);
table = (table_type *)malloc(total_processes * sizeof(table_type));
for(i = 0; i < total_processes; i++){
int arrival = -1;
int total_cycles = -1;
printf("Enter process id: ");
scanf("%d", &table[i].id);
}
printf("Enter arrival cycle for process P[%d]: ", i);
scanf("%d", &table[i].total_cycles);
/*
table[i].id = i;
table[i].arrival = -1;
table[i].total_cycles = -1;
table[i].start = -1;
table[i].end = -1;
table[i].turnaround = -1;
*/
print_table();
return;
}
/***************************************************************/
void procedure_2() {
/* "PROCEDURE FOR OPTION #2"
/* declare (and initilize when appropriate) local variables */
/* for each process, reset "done" field to 0 */
/* while there are still processes to schedule */
/* initilize the earliest arrival time to INT_MAX
(largest integer value) */
/* for each process not yet scheduled */
/* check if process has earlier arrival time
than current earliest and update */
/* set start time, end time, turnaround time, done fields
for unscheduled process with earliest arrival time */
/* update current cycle time and increment number of
processes scheduled */
/* print contents of table */
int i;
int done;
int min_value;
int current_cycle = 0;
int max;
int min_index;
table[i].done = 0;
while(done < 1){
min.
I am Baddie K. I am a C++ Homework Expert at cpphomeworkhelp.com. I hold a Masters in Programming from The University of Queensland. I have been helping students with their homework for the past 9 years. I solve homework related to C++. Visit cpphomeworkhelp.com or email info@cpphomeworkhelp.com. You can also call on +1 678 648 4277 for any assistance with C++ Homework.
make sure to discuss the following•your understanding of t.docxcarliotwaycave
make sure to discuss the following
•
your understanding of the purpose of the research
•
what the researchers found (i.e., the results of the research study)
•
the broader implications or practical application of the research
•
any problems you see in the research study
•
what the researchers might have done differently to improve their study
•
future research that might be conducted in this particular research area
.
make sure to discuss the following•your understanding of .docxcarliotwaycave
make sure to discuss the following:
•
your understanding of the purpose of the research
•
what the researchers found (i.e., the results of the research study)
•
the broader implications or practical application of the research
•
any problems you see in the research study
•
what the researchers might have done differently to improve their study
•
future research that might be conducted in this particular research area
.
More Related Content
Similar to Instruction1. Please read the two articles. (Kincheloe part 1 &.docx
It seemed that long forum debates about methods of measuring algorithm's running time, functions to use and precision that should be expected were over. Unfortunately, we have to return to this question once again. Today we will discuss the question how we should measure speed of a parallel algorithm.
Programming For Big Data [ Submission DvcScheduleV2.cpp and StaticA.pdfssuser6254411
Programming For Big Data [ Submission: DvcScheduleV2.cpp and StaticArray.h and/or
DynamicArray.h ]
Assignment 5's runtime was too slow -- a couple of minutes or so. It's because of the duplicate-
checking, with over 4 billion compares.
Rewrite the duplicate-checking logic from Assignment 5, using a technique from "Techniques
For Big Data, Reading" to do fewer compares (check the term first then section number for the
duplicate check), and come up with the exact same results as Assignment 5.
You may use your StaticArray.h from Assignment 3 and/or your DynamicArray.h from
assignments 4, but you may not use any STL containers. Submit the H file(s) you use in your
solution, even if there are no changes since your previous work. Your project will be compiled
for grading using the default stack memory size of 1MB.
Since this version is supposed to be fast, there is no longer a need for a progress bar. Include one
if you wish (you may see the run time dramatically changed), or you may leave it out -- your
choice. But if you do have a progress bar, do remember to "flush"...
[Submission] - Submit the driver program (DvcScheduleV2.cpp) with the header files used
The code I wrote for previous assignment:
Main:
#include
#include
#include
#include
#include "DynamicArray.h"
using namespace std;
struct Class
{
string code;
int count;
};
int main()
{
DynamicArray sub;
DynamicArray sem;
DynamicArray sec;
int totalSubjects = 0;
int dup = 0;
int total = 0;
int counter = 0;
bool duplicate;
bool stored;
// For parsing input file
char* token;
char buf[1000];
const char* const tab = "\t";
// Open input file
ifstream fin;
fin.open("dvc-schedule.txt");
if (!fin.good())
{
cout << "I/O error. File can't be found!\n";
return 1; // Exit the program with an error code
}
// Read the input file
while (fin.good())
{
// Progress bar
if (counter % 1000 == 0)
{
cout << '.';
cout.flush();
}
duplicate = false;
stored = false;
string line;
getline(fin, line);
total++; // Total lines processed
strcpy(buf, line.c_str());
if (buf[0] == 0)
continue; // Skip blank lines
// Parse the line
const string term(token = strtok(buf, tab));
const string section(token = strtok(0, tab));
const string course((token = strtok(0, tab)) ? token : "");
const string instructor((token = strtok(0, tab)) ? token : "");
const string whenWhere((token = strtok(0, tab)) ? token : "");
if (course.find('-') == string::npos)
continue;
const string code(course.begin(), course.begin() + course.find('-'));
// Check for duplicates
for (int i = 0; i < counter; i++)
{
if (sem[i] == term && sec[i] == section)
{
dup++;
duplicate = true;
break;
}
}
if (duplicate == true)
continue;
sem[counter] = term;
sec[counter] = section;
counter++;
for (int i = 0; i < totalSubjects; i++)
{
if (sub[i].code == code)
{
sub[i].count++;
stored = true;
break;
}
}
if (stored == true)
continue;
Class y;
y.code = code;
y.count = 1;
sub[totalSubjects] = y;
totalSubjects++;
}
fin.close();
cout << endl;
for (int i = 0; i < totalSubjects; i++)
{
f.
Need help implementing the skeleton code below, I have provided the .pdfezzi552
I need help with this practice problem?
Execute the following coding segment and identify the errors in the program. Debug the program
and provide the correct version of the code. Hinclude int main() printf(\"%s\", isdigit(\'A\') ? \"A
is digit\" \"A is not digit\"); a : a printf(\"Inlnln\") return return e;
Solution
in range [0,9]. If it\'s not then this function returns 0.
Given program compiles successfully, compiler does not give any error.
But If the input of isdigit(\'A\') is changed then the program will always print
\"A is a digit\" or
\"A is not a digit\" .
It will not print exact value of char A.
So, correct code is given below.
#include
int main()
{
char A = \'1\';
printf(\"%c%s\",A,isdigit(A)? \" is a digit\" : \" is not a digit\");
printf(\"\ \");
A = \'B\';
printf(\"%c%s\",A,isdigit(A)? \" is a digit\" : \" is not a digit\");
printf(\"\ \");
return 0;
}
Sample Output:
1 is a digit
B is not a digit.
Video games are written as a main loop: process player input, update the state of the game, render a new frame to the screen, repeat. They do this 60 times a second, with millisecond timing. Most monitoring tools are also written as loops: send a probe, wait for the response, update a data store, sleep. Often this is done pretty slowly, maybe once a second! In video games if you can’t update fast enough, you skip the rendering step and the frame rate drops. With monitoring tools if your loop takes to long you also stop logging data as often, and instead of choppy gameplay you get gaps in your graphs, often when you need that data the most!
Let’s use ping as an example and see how we can rewrite its main loop to function more like a video game, keeping a high frame rate.
Adam Sitnik "State of the .NET Performance"Yulia Tsisyk
MSK DOT NET #5
2016-12-07
In this talk Adam will describe how latest changes in.NET are affecting performance.
Adam wants to go through:
C# 7: ref locals and ref returns, ValueTuples.
.NET Core: Spans, Buffers, ValueTasks
And how all of these things help build zero-copy streams aka Channels/Pipelines which are going to be a game changer in the next year.
Here is the code- I can't get it to work- I need a function that finds.pdfdoshirajesh75
Here is the code: I can't get it to work. I need a function that finds the maximum of two integers.
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
/* declare global variables including a table structure to hold scheduling
information */
/* optional: define a function that finds the maximum of two integers */
int total_processes = 0;
struct node{
int id;
int arrival;
int total_cycles;
int total_remaining;
int done;
int start;
int already_started;
int end;
int turnaround;
}* table = NULL;
typedef struct node table_type;
/***************************************************************/
void print_table() {
/*
1.declare local variables
2. print table header
3. for each process
4. print the contents (id, arrival time, total_cycles) of
each field of the table's index
5. if process has been scheduled ("done" field is 1,
6. print other contents (start time, end time, turnaround time)
*/
printf("ID/tArrival/tTotal/tStart/tEnd/tTurnaround/n");
printf("--------------------------------------------\n");
int i;
for(i=0; i < total_processes; i++){
printf("%d\t", table[i].id);
printf("%d\t", table[i].arrival);
printf("%d\t", table[i].total_cycles);
printf("%d\t", table[i].start);
printf("%d\t", table[i].end);
printf("%d\t", table[i].turnaround);
}
return;
}
/***************************************************************/
void procedure_1() {
/*"PROCEDURE FOR OPTION #1"
/* declare local variables */
/* prompt for total number of processes */
/* allocate memory for table to hold process parameters */
/* for each process */
/* prompt for process id, arrival time, and total cycle
time */
/* print contents of table */
int i;
printf("Enter total number of processes: ");
scanf("%d", &table[i].arrival);
table = (table_type *)malloc(total_processes * sizeof(table_type));
for(i = 0; i < total_processes; i++){
int arrival = -1;
int total_cycles = -1;
printf("Enter process id: ");
scanf("%d", &table[i].id);
}
printf("Enter arrival cycle for process P[%d]: ", i);
scanf("%d", &table[i].total_cycles);
/*
table[i].id = i;
table[i].arrival = -1;
table[i].total_cycles = -1;
table[i].start = -1;
table[i].end = -1;
table[i].turnaround = -1;
*/
print_table();
return;
}
/***************************************************************/
void procedure_2() {
/* "PROCEDURE FOR OPTION #2"
/* declare (and initilize when appropriate) local variables */
/* for each process, reset "done" field to 0 */
/* while there are still processes to schedule */
/* initilize the earliest arrival time to INT_MAX
(largest integer value) */
/* for each process not yet scheduled */
/* check if process has earlier arrival time
than current earliest and update */
/* set start time, end time, turnaround time, done fields
for unscheduled process with earliest arrival time */
/* update current cycle time and increment number of
processes scheduled */
/* print contents of table */
int i;
int done;
int min_value;
int current_cycle = 0;
int max;
int min_index;
table[i].done = 0;
while(done < 1){
min.
I am Baddie K. I am a C++ Homework Expert at cpphomeworkhelp.com. I hold a Masters in Programming from The University of Queensland. I have been helping students with their homework for the past 9 years. I solve homework related to C++. Visit cpphomeworkhelp.com or email info@cpphomeworkhelp.com. You can also call on +1 678 648 4277 for any assistance with C++ Homework.
Similar to Instruction1. Please read the two articles. (Kincheloe part 1 &.docx (20)
make sure to discuss the following•your understanding of t.docxcarliotwaycave
make sure to discuss the following
•
your understanding of the purpose of the research
•
what the researchers found (i.e., the results of the research study)
•
the broader implications or practical application of the research
•
any problems you see in the research study
•
what the researchers might have done differently to improve their study
•
future research that might be conducted in this particular research area
.
make sure to discuss the following•your understanding of .docxcarliotwaycave
make sure to discuss the following:
•
your understanding of the purpose of the research
•
what the researchers found (i.e., the results of the research study)
•
the broader implications or practical application of the research
•
any problems you see in the research study
•
what the researchers might have done differently to improve their study
•
future research that might be conducted in this particular research area
.
make sure to discuss the following•your understanding o.docxcarliotwaycave
make sure to discuss the following:
•
your understanding of the purpose of the research
•
what the researchers found (i.e., the results of the research study)
•
the broader implications or practical application of the research
•
any problems you see in the research study
•
what the researchers might have done differently to improve their study
•
future research that might be conducted in this particular research area
.
Major DiseasesCHAPTER 10Chapter 10Maj.docxcarliotwaycave
Major Diseases
CHAPTER 10
*
Chapter 10
Major Diseases
Learning Outcomes:Identify agents and vectors involved in the spread of infectious diseasesDescribe the process of infection, and the role of the body’s immune systemDiscuss prevention and treatments for colds and influenzaName and describe common infectious diseasesEvaluate your personal infectious disease risk factors, and strategies to decrease risk
Infectious Diseases
Infection is triggered by a pathogen (disease-causing organism) that is transmitted to the host (person or population) by a vector (biological or physical vehicle)
Types of microbes that can cause infection are:
Viruses Fungi
Bacteria Protozoa
Helminths (Parasitic Worms)
Agents of Infection: VirusesThe most common viruses are as follows:Rhinoviruses and Adenoviruses: which get into the mucous membranes and cause upper respiratory tract infections and coldsInfluenza viruses: can change their outer protein coats so dramatically that individuals resistant to one strain cannot fight off a new oneHerpes viruses: take up permanent residence in the cells and periodically flare upPapillomaviruses: may be responsible for a rise in the incidence of cervical cancer among younger womenHepatitis viruses: cause several forms of liver infection, ranging from mild to life threateningSlow viruses: give no early indication of their presence but can produce fatal illnesses within a few years
Agents of Infection: Viruses cont’dRetroviruses: named for their backward (retro) sequence of genetic replication compared to other viruses. One retrovirus, human immunodeficiency virus (HIV), causes acquired immune deficiency syndrome (AIDS)
Filoviruses: resemble threads and extremely lethal
Coronavirus 2019-COVID-19CDC is responding to a pandemic of respiratory disease spreading from person-to-person caused by a novel (new) coronavirus. The disease has been named “coronavirus disease 2019” (abbreviated “COVID-19”)
COVID-19 is caused by a coronavirus. Coronaviruses are a large family of viruses that are common in people and many different species of animals, including camels, cattle, cats, and bats. Reported illnesses have ranged from very mild (including some with no reported symptoms) to severe, including illness resulting in death. Older people and people of all ages with severe chronic medical conditions — like heart disease, lung disease and diabetes, for example — seem to be at higher risk of developing serious COVID-19 illness
Agents of InfectionBacteria: are the most plentiful microorganisms as well as the most pathogenic. Bacteria harm the body by releasing either enzymes that digest body cells or toxins that produce the specific effects of diseases such as diphtheria or toxic shock syndromeFungi: consist of threadlike fibers and reproductive spores. Fungi lack chlorophyll and must obtain their food from organic material, which may include human tissueProtozoa: single-celled, microscopic animals release enzymes.
Main questions of the essay1. What are types of daily-lived situat.docxcarliotwaycave
Main questions of the essay
1. What are types of daily-lived situations that confront undocumented youth sense of identity and belonging?
2. What types of psychological trauma impacts gow undocumented youth negotiate their daily lived situations?
3. How do undocumented youth respond to their daily psychological trauma that they experienced?
Use some examples to describe those experiences happened to those undocument youth, it can be made up.
In the Conclusion, provide some solution. Picture yourself as a policy maker.
.
Make a simple plan to observe and evaluate a facility in your school.docxcarliotwaycave
Make a simple plan to observe and evaluate a facility in your school or surrounding community , and recomond somethings in order to improve it ( write an essay about this article )
#Requirements
200 words
MLA style
should have basic words
Should have an introduction,two bodies,and conclusion.
.
Major Approaches to Clinical Psychology PresentationSelect one.docxcarliotwaycave
Major Approaches to Clinical Psychology Presentation
Select
one of the following psychological diagnoses:
·
Depressive disorder
·
Generalized anxiety disorder
·
Attention deficit hyperactivity disorder
·
Obsessive-compulsive disorder
Create
a 9-12 slide Microsoft
®
PowerPoint
®
presentation, with Speaker Notes;
You have been asked to provide a presentation regarding psychological issues for a local community organization. Your audience is made up of adults within the community who are
not
mental health professionals, and who are interested in learning more about a specific mental health issue.
Provide
a brief explanation of the mental health issue chosen, including primary symptoms, diagnostic criteria, populations most affected, and prevalence within the U.S.
Discuss
each of the major theories in Psychology: psychodynamic, cognitive-behavioral, humanistic, and family systems approaches.
Compare and contrast
the major approaches in relation to your selected psychological issue.
Include the following:
When, how, and why each approach developed, and identify psychologists most associated with the approach.
Terms and concepts associated with the psychological approach.
The techniques and strategies used by each approach, and the goals of treatment.
The effectiveness of each approach towardtreating yourselected diagnosis, based on treatment outcome research.
Incorporate
information from at least five peer-reviewed, professional publications.
Cite
each source you have relied upon throughout the body of your presentation, and list them on a separate slide titled
References
. Use direct quotes only sparingly.
Format
your paper consistent with APA guidelines.
Submit
a signed Certificate of Originality document.
.
Make a powerpoint presentation. At least 4 to 6 pages. Your pape.docxcarliotwaycave
Make a powerpoint presentation. At least 4 to 6 pages.
Your paper should include a cover page (setting forth the title of the paper, your name, the course number, and the date), and a bibliography.
Your paper should include an introductory paragraph, a comprehensive but concise analysis of the topic, and a conclusion paragraph.
.
Make a 150 word response to the following. Incorporarte what was sai.docxcarliotwaycave
Make a 150 word response to the following. Incorporarte what was said in 1.In your response. Discuss some of the qualities that can make art "great." Use texbook: Getlein, Mark. Living with Art, 9th Ed., New York: McGraw-Hill, 2010. Chapters 1-5
1. Although beauty is in the eye of the beholder, certain criteria should be looked at or met to consider something art. The same applies to calling someone an artist. Getlein first discusses that artists create places that fulfill a purpose for humans. Examples of this include Stonehenge and the Vietnam Memorial. Artists also exaggerate or give new perspective on ordinary objects to make them seem extraordinary. Another thing artists accomplish is using their art to record history. Their art could remind people of a different time or era in human history. For example, a painting for an ancient Chinese dynasty gives us insight into that era. Artists give form to things that cannot be seen or understood. This mostly includes statues, paintings, etc. of various deities. This same idea can also be applied when artists give form to feelings or ideas. This is shown in Van Gogh's famous painting called The Starry Night. Lastly, artists can give us a new or refreshing perspective on the world.
An artist or their art must meet one of these criteria to be considered art. These six criteria show how influential and important art has been to human culture and society for a very long time. Art gives us glimpses into times that are long gone and clues to a different culture.
Make a 150 word response to the following. Incorporate what is said in 2. In your response. What factors make a work of art valuable in different ways to different people? Use texbook: Getlein, Mark. Living with Art, 9th Ed., New York: McGraw-Hill, 2010. Chapters 1-5
2. Unity is when pieces come together in art to form a cohesive whole. Variety is the difference in these pieces to be more interesting. An example of these concepts is figure 3.8 on page 56. Guernica by Pablo Picasso is a painting of disfigured animals and people that seem chaotic. Different images can be seen throughout the painting. Unity is shown because all the individual objects and people come together to give you a large picture. Variety is also shown because many of the animals like the horse are disfigured and almost cartoonish. I chose this work because looking at the individual pieces of the picture seem strange but they come together to show some kind of conflict.
Symmetrical balance is when the center of gravity in a piece of art is vertical. The two sides of the art must also correspond to each other. An example of this is figure 3.1 on page 51. A picture of interior upper chapel of the Sainte-Chappelle in Paris is shown. This artwork in the chapel shows symmetrical balance because there is an implied line down the middle of the design where a door is and both sides mirror each other perfectly. Asymmetrical balance is when two sides of the art do not correspond w.
Major dams and bridges were built by the WPA during the New Deal o.docxcarliotwaycave
Major dams and bridges were built by the WPA during the "New Deal" of President Franklin Roosevelt in the 1930s and 1940s and have withstood decades. The American Interstate Highway system came into being during the Eisenhower presidential years over 60 years ago. Sewers were built several generations ago. In more exact terms, the United States' infrastructure system is old and beginning to rapidly deteriorate. How do you feel about the aging of United States' infrastructure? Explain.
How would you recommend a strategy to repair or replace the various aging critical infrastructure? Explain.
What major challenges or barriers exist? Explain.
How do you think they could be overcome?
What types of technologies can be used in determining weaknesses in the integrity of infrastructure construction? Explain.
In your opinion, are these technologies effective? Why or why not?
How often do you think critical components should be inspected for weaknesses and vulnerabilities? Explain your rationale.
In your own words, please post a response to the Discussion Board and comment on at least two other postings. You will be graded on the quality of your postings.
For assistance with your assignment, please use your text, Web resources, and all course materials.
Unit Materials
.
Major Paper #1--The Point of View EssayWe will be working on this .docxcarliotwaycave
Major Paper #1--The Point of View Essay
We will be working on this paper for the next three units. The final draft of the paper--with all three sections described below--will be due at the end of Unit #4.
Purpose:
This paper assignment has several purposes. As the first major paper for this class, the Point of View Essay is designed to re-engage you with the fundamentals of all good writing, including using lush sensory details to show the reader a particular place (rather than tell them about it), basic organization, clear focus, etc. However, this unit does not function as a mere review. The Point of View Essay will also introduce you to the concept of "thinking and seeing rhetorically, and analyzing writing rhetorically"--using the Writer's Toolbox described in this unit to improve your writing and critical reading skills. Finally, the Point of View Essay allows you to reflect on this process.
The Assignment:
1. Pleasant/Unpleasant Description of the Place:
Choose a place you can observe for an extended period of time (at least 20-30 minutes). Use all of your senses (sight, hearing, touch, smell, even taste if possible) to experience the place, and record all of the sensations that you experience. As you record your data, you may wish to note which details naturally seem more positive, negative, or neutral, in terms of tone. (For instance, a stinky and overflowing trash barrel swarming with flies in a nearby alley might seem more inherently negative than a little white bunny rabbit hopping playfully across the lawn.) Then, you will use this information to help your write two descriptions of the place: one positive, one negative (at least 1-2 well-developed paragraphs or a minimum of 125-150 words each). Both descriptions should be factually true (same real time and real place), but you will want one description to be clearly positive in terms of tone and the other to be clearly negative. In addition to including the information and sensory details you've collected as the basis for these descriptions, you will also use the Writer's Toolbox to create your two contrasting impressions for this assignment. (The Writer's Toolbox is explained in the Lecture Notes section of this unit.) As you revise and refine your descriptions, please be sure you are "showing" your readers your place (really putting the readers "there" in the moment and in this scene), rather than simply "telling" them about it. You will also want to try to eliminate unnecessary linking verbs as much as you can, incorporating verbs that show "action" whenever possible.
2. Rhetorical Analysis:
Looking back at your descriptions, analyze how you created these two very different impressions of the place (one positive, one negative) without changing any of the facts. How did you make your place seem so positive in one paragraph and yet so negative in the other paragraph, without changing the facts? Discuss how you incorporated each of the tools from the Writer's T.
Major Essay for Final needs to be 5 pages long on the topic below an.docxcarliotwaycave
Major Essay for Final needs to be 5 pages long on the topic below and in Mla format with wroks citied AFTER he five pages due at 12:15 today
Requriements: 5 pages long
secondary sources 2 credible , 2 academic
Mla format (in-text ciations + works cited page)
focused specific paper topic
Identifiable methods of compostion choosen wisely
Topic Propsal:
The Media’s Influences on Society
The topic I chose to write my major essay on is the media’s influences on society.
This includes both positive and negative influences that the media portrays which plays a big part in society. I will explain how and why the media is used for much more than just entertainment purposes for society and how the media affects the choices society makes and its outcomes. The media affects society with these influences because it alters the way people think and it plays a role in the choices the people make. The change in peoples thoughts do to influences from what they see creates an opportunity for them to either make a good or bad choice depending on the type of influence that is shown. I believe that most of time the media portrays negative influences upon society. A positive influence from the media would be a commercial or show/clip about stopping bullying that informs people about the topic and why bullying is wrong and how it affects the lives of the victims. This type of media would influence society in a positive way because it would actually get society thinking about the situation and for the bullies some of them will actually realize the harm they are causing there victims and they would probably stop bullying people. A negative influence of the media would be a song with someone talking about how they murder people and take drugs and make it in a way to make people think it’s “cool” and then people who listen to it start imitating the things talked about in the song because they want to be “cool”. What I hope to accomplish with this essay is to open people eyes and help them see that the things they watch and listen to as in media actually alter the way they think and the choices they make so hopefully they change what they listen to and watch to more positive things.
The reason I chose to write about the media and its influences on society is to inform people that media has a bigger purposes than just entertainment for society and to hopefully help people make better choices and actually pay attention to the things they watch and listen to. I see how the media influence our modern society everywhere, at the basketball courts at the park at stores. Some of the people at the basketball courts I go to start listening to music that talk about drugs, gangs, murder and they start acting tough, being stupid and talking reckless and they get into arguments or even worse end up getting into fights and someone gets hurt I see this all the time. My paper is important because it will help shed light on the media motives and hopefully start making people m.
Major AssignmentObjectivesThis assignment will provide practice .docxcarliotwaycave
Major Assignment
Objectives
This assignment will provide practice and experience in:
·
Writing a program – Topic 2
·
Debugging– Topic 3
·
Stepwise Refinement& Modularisation – Topic 4 and Topic 10
·
Selection – Topic 5
·
Iteration – Topic 6
·
Arrays – Topic 7
·
File handling – Topic 9
·
Structs – Topic 11
NB Depend
i
ng on when you start this assignment you may need to read ahead especially on how to use files andstructs.
Suggestions:
Read the assignment specifications carefully first.Write the first version of your program in Week 4 and then create new versions as you learn new topics. Do NOT leave it until Week 11 to start writing the program. Review Topic 4 on stepwise refinement. This is how you should approach the major. Also note that though your program must do something and must compile it does not have to be complete to earn marks.
Specifications
One of the many tasks that programmers get asked to do is to convert data from one form to another. Frequently data is presented to users in well-labelled, tabular form for easy reading. However, it is impossible or very difficult to do further processing of the data unless it is changed into a more useful form.
For the purposes of this assignment I have downloaded and will make available the undergraduate applications to the 37 Australian universities from the Department of Education for 2009 – 2013 data file as a text file.
Your program will load this data into an array of structs, save the data in a form that is directly usable by a database (see below), display the data on the console in its original form and in its database form. It will also allow the user to display the highest number of applications for a given state and year.
Your program will use a menu to allow the user to choose what task is to be done. You will only be required to handle the Applications data. You can ignore the Offers and Offers rates data (see below).
Data
See “undergraduateapplicationsoffersandacceptances2013appendices.txt” for the original data.
This is the data your program should produce and save:
New South Wales Charles Sturt University 4265 4298 4287 4668 4614
New South Wales Macquarie University 6255 6880 7294 7632 7625
New South Wales Southern Cross University 2432 2742 2573 2666 2442
New South Wales The University of New England 1601 1531 1504 1632 1690
New South Wales The University of New South Wales 10572 10865 11077 11008 11424
New South Wales The University of Newcastle 9364 9651 9876 10300 10571
New South Wales The University of Sydney 13963 14631 14271 14486 15058
New South Wales "University of Technology, Sydney" 10155 9906 9854 10621 9614
New South Wales University of Western Sydney 11251 11.
magine that you are employed by one of the followingT.docxcarliotwaycave
magine
that you are employed by one of the following:
The social services division of a state or city government
A citizen action committee made up of community members
A police or fire department
A school or educational organization (public or private)
Develop
a 1,050- to 1,400-word needs statement and management plan that will be part of a proposal for a fictitious, grant-funded project of your choosing on behalf of your agency or organization. Include the following sections in your submission:
Paragraph One: Describe the characteristics of your fictitious agency or organization.
Paragraph Two: Discuss the possible funding sources you might contact for this grant proposal.
Needs Statement: Establish the specific problem the proposed project will address.
Management Plan: Describe the responsibilities of the project director (you) and any staff you will employ to implement the grant.
Format
your paper in accordance with APA guidelines.
Submit
your assignment.
Resources
Center for Writing Excellence
Reference and Citation Generator
Grammar and Writing Guides
Copyright 2018 by University of Phoenix. All rights reserved.
.
M4D1 Communication TechnologiesIn this module, we have focused .docxcarliotwaycave
M4D1: Communication Technologies
In this module, we have focused on understanding and using new communication technologies to be more competent communicators.
Respond to the following:
What social media strategy would you recommend for your current (or previous) workplace?
What areas do you think your organization can still improve?
How would you explain the importance of social media to your employer?
.
Luthans and Doh (2012) discuss three major techniques for responding.docxcarliotwaycave
Luthans and Doh (2012) discuss three major techniques for responding to political risk. Should an international organization always use all three techniques? Why or why not?
Your response should be at least 150 words in length. All sources used must be referenced; paraphrased and quoted material must have accompanying citations.
www.obm.nsaem.ru/.../International%20Management_
Main
Textbook.pd
.
Lyddie by Katherine Paterson1. If you were Lyddie how would you h.docxcarliotwaycave
Lyddie by Katherine Paterson
1. If you were Lyddie how would you have handled the incident with mr marsen?
2. Explain how Charlie's visit is a turning point in the story
3. How does Paterson show how important it is for a person to have goals in life
4. What are three examples that Lyddie supports her self pity with when she feels she has been too late for everything
5. What do we learn about Diana and how does this new development change Lyddies role in the factory
6. What event occurs in chapter 20 that was foreshadowed earlier? What predictions can you make about Lyddie's future
.
Luthans and Doh (2012) discuss feedback systems. Why is it important.docxcarliotwaycave
Luthans and Doh (2012) discuss feedback systems. Why is it important to consider an effective feedback system as an international manager?
Your response should be at least 150 words in length. All sources used must be referenced; paraphrased and quoted material must have accompanying citations.
www.obm.nsaem.ru/.../International%20Management_
Main
Textbook.pdf
use pages 212-215
.
Luthans and Doh (2012) discuss factors affecting decision-making aut.docxcarliotwaycave
Luthans and Doh (2012) discuss factors affecting decision-making authority. Briefly describe at least three factors that affect decision-making authority.
I attached chapter 11 to the reflection paper assignment so you can use that to answer this question
thank you
Your response should be at least 200 words in length. All sources used must be referenced; paraphrased and quoted material must have accompanying citations.
[removed][removed][removed][removed]
.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Instruction1. Please read the two articles. (Kincheloe part 1 &.docx
1. Instruction:
1. Please read the two articles. (Kincheloe part 1 & 2)
2. Please choose some of the topics covered in each chapter,
provide a brief summary (2-3 sentences) of those topics.
3. Then add your reflections, insights, or relevant experiences,
etc. to help illustrate or expand upon the course.
4. This journal should be at least 400 words.
p5-start.cppp5-start.cpp/**
* @author Jane Student
* @cwid 123 45 678
* @class CSci 430, Spring 2018
* @ide Visual Studio Express 2010
* @date November 15, 2018
* @assg prog-04
*
* @description This program implements a simulation of proce
ss
* scheduling policies. In this program, we implement round-
robin
* scheduling, where the time slice quantum can be specified a
s
* as a command line parameter. And we also implement shor
test
* remaining time (SRT) scheduling policy
*/
#include<stdlib.h>
#include<iostream>
#include<iomanip>
#include<fstream>
#include<string>
#include<list>
2. usingnamespace std;
// global constants
// I won't test your round robin implementation with more than 2
0 processes
constint MAX_PROCESSES =20;
constint NO_PROCESS =0;
// Simple structure, holds all of the information about processes,
their names
// arrival and service times, that we are to simulate.
typedefstruct
{
string processName;
int arrivalTime;
int serviceTime;
// holds running count of time slices for current time quantum,
when
// serviceTime == quantum, time slice is up
int sliceTime;
// holds total number of time steps currently run, when == to
// serviceTime process is done
int totalTime;
// holds time when process finishes, used to calculate final stats,
// like T_r, T_r/T_s
int finishTime;
// a boolean flag, we will set this to true when the process is co
mplete
bool finished;
}Process;
// Process table, holds table of information about processes we a
re simulating
typedefstruct
{
3. int numProcesses;
Process* process[MAX_PROCESSES];
}ProcessTable;
/** Create process table
* Allocate memory for a new process table. Load the process
* information from the simulation file into a table with the proc
ess
* information needed to perform the simulation. At the same ti
me we
* initialize other information in process table for use in the
* simulation. Return the newly created ProcessTable
*
* @param processFilanem The name (char*) of the file to open
and read
* the process information from.
* @param processTable This is actually a return parameter. Th
is
* should be a pointer to an already allocated array of
* Process structure items. We will fill in this structure
* and return the process information.
*
* @returns ProcessTable* The newly allocated and initialized P
rocessTable
* structure.
*/
ProcessTable* createProcessTable(char* processFilename)
{
ifstream simprocessfile(processFilename);
ProcessTable* processTable;
int pid;
string processName;
int arrivalTime;
int serviceTime;
4. // If we can't open file, abort and let the user know problem
if(!simprocessfile.is_open())
{
cout <<"Error: could not open process simulation file: "
<< processFilename << endl;
exit(1);
}
// Format of file is
// ProcessName1 ArrivalTime1 ServiceTime1
// ProcessName2 ArrivalTime2 ServiceTime2
// ...
// ProcessNameN ArrivalTimeN ServiceTimeN
//
// Where the name is any arbitray string identifier, and ArrivalT
ime
// and ServiceTime are integer values
pid =0;
processTable =new(ProcessTable);
while(simprocessfile >> processName >> arrivalTime >> servic
eTime)
{
// allocate a new process to hold information
Process* process =new(Process);
processTable->process[pid]= process;
// load information into process read from simulation file
process->processName = processName;
process->arrivalTime = arrivalTime;
process->serviceTime = serviceTime;
// initialize other process information for the simulaiton
process->sliceTime =0;
process->totalTime =0;
process->finishTime =0;
process->finished =false;
5. pid++;
}
// Set the number of processes we need to simulate information i
n
// the process table
processTable->numProcesses = pid;
return processTable;
}
/** Display process table
* Convenience method, dump all of the information about the p
rocesses
* in a process table to stdout.
*
* @param processTable The table, a pointer to type ProcessTab
le
* struct, with the information we are to display
*/
void displayProcessTable(ProcessTable* processTable)
{
cout <<"Process Table num = "<< processTable-
>numProcesses << endl;
cout <<"PID Name Arrv Srvc"<< endl;
cout <<"------------------"<< endl;
for(int pid=0; pid < processTable->numProcesses; pid++)
{
Process* p = processTable->process[pid];
cout << setw(2)<< right << pid <<") ";
cout << setw(4)<< left << p->processName <<" ";
cout << setw(4)<< right << p->arrivalTime <<" ";
cout << setw(4)<< right << p->serviceTime <<" ";
cout << endl;
6. }
}
/** Round robin scheduler simulator
* The main routine for performing the round robin preemptive
* scheduler simulator. We expect the time quantum to already
be
* specified and given to us as the first parameter. The file nam
e
* with the process arrival and service time information is given
as
* the second parameter. We simulate preemptive round robin
* scheduling of all of the processes until there are no longer an
y
* processes left in the system (all processes have exceeded thei
r
* service time and have exited).
*
* @param processTable A pointer to a ProcessTable structure h
olding
* information about the processes, arrival times and duratio
ns
* that we are simulating execution of.
* @param quantum An integer value holding the time slice qua
ntum we
* are using for this simulation.
*/
void roundRobinScheduler(ProcessTable* processTable,int quan
tum)
{
// Implement the round robin scheduler here
cout <<"<roundRobinScheduler> entered, quantum: "<< quant
um << endl;
}
7. /** shortest remaining time simulator
* The main routine for performing the shortest remaining time
* preemptive scheduler simulator. The file name with the proc
ess
* arrival and service time information is given as the first
* parameter. We simulate preemptive shortest remaining time
* scheduling of all of the processes until there are no longer an
y
* processes left in the system (all processes have exceeded thei
r
* service time and have exited).
*
* @param processTable A pointer to a ProcessTable structure h
olding
* information about the processes, arrival times and duratio
ns
* that we are simulating execution of.
*/
void shortestRemainingTime(ProcessTable* processTable)
{
// Implement the shortest remaining time policy here
cout <<"<shortestRemainingTime> entered"<< endl;
}
/** Main entry point of round robin scheduler
* The main entry point of the round robin scheduler simulator.
The main funciton
* checks the command line arguments, and calls the simulation
function if correct
* arguments were supplied. We expect two command line argu
ments, which are the
* time slice quantum value we are to use for this preemptive sc
heduler simulation,
* and the name of the simulation file holding the process arriva
8. l and service
* time information.
*
* @param argc The argument count
* @param argv The command line argument values. We expect
argv[1] to be the
* time slice quantum parameter (int format) and argv[2
] to be the
* name of the process simulation file (charcter string)
*/
int main(int argc,char** argv)
{
string policy;
ProcessTable* processTable;
int quantum =0;
// If not all parameters provides, abort and let user know of prob
lem
if(argc <3|| argc >4)
{
cout <<"Error: expecting process simulation file and scheduli
ng policy as command line parameters"
<< endl;
cout <<"Usage: "<< argv[0]<<" process-
file.sim [rr|srt] [quantum]"<< endl;
exit(1);
}
// load process table and parse command line arguments
processTable = createProcessTable(argv[1]);
// just to confirm that process table loaded correctly. You shoul
d
// comment out or remove this as it is not asked for as part of th
e
// output for the assignment simulation
displayProcessTable(processTable);
9. // determine policy to simulate
policy.assign(argv[2]);
// perform simulation of indicated scheduling policy
if(policy =="rr")
{
if(argc !=4)
{
cout <<"Error: time quantum must be provided for round ro
bin `rr` scheduling policy"<< endl;
exit(1);
}
quantum = atoi(argv[3]);
if((quantum <=0)||(quantum >1000))
{
cout <<"Error: received bad time slice quantum parameter:
"<< argv[1]<< endl;
cout <<" valid values are integers in range from 1 to 10
00"<< endl;
exit(1);
}
roundRobinScheduler(processTable, quantum);
}
elseif(policy =="srt")
{
shortestRemainingTime(processTable);
}
else
{
cout <<"Error: unknown process scheduling policy: "<< polic
y << endl;
}
}
10. prog-05.pdf
Programming Assignment #5
CSci 430, Spring 2019
Dates:
Assigned: Monday April 15, 2019
Due: Wednesday May 1, 2019 (before Midnight)
Objectives:
� Understand short-term process scheduling.
� Work with data structures to implement a round-robin
scheduler.
� Look at e�ects of di�erent time slice quantum sizes on the
round-robin scheduling algorithm.
� Use C/C++ to implement vector and matrix data structures,
get practice in creating and using
such data structures in C/C++.
Description:
Our textbooks chapter 9 discusses several possible short-term
process scheduling policies. In this
programming assignment exercise we will implement two of the
preemptive policies, the simple shortest
remaining time policy (SRT) and the round-robin scheduler with
preemptive time slicing. Your program
will be given a simple input �le, indicating the process name,
11. its arrival time and its total service time,
the same as the process scheduling examples from our textbook
in Table 9.4 and Figure 9.5. You will
simulate the execution of the required schedulers. As in
previous assignments, you program will need
to work non-interactively and be callable from the command
line. The program will be provided with
the �le name of a �le with process information, in the format
discussed below. Your program will also
be given the time slicing quantum parameter it is to use for the
simulation, if round-robin scheduling
is selected. Your program will need to output the results of
running the set of simulated processes
using the selected scheduling policy with the indicated time
slice for the round-robin scheduler. Your
program will have to output its results exactly as shown below
in the required output format. Your
program will also need to calculate some summary statistics for
the simulated processes, including the
turnaround time and Tr/Ts ratio for each process, and the mean
Tr and Tr/Ts values for the given
simulation.
Process simulation �le formats
The �les with the information about the processes to be
simulated are fairly simple, and have the same
information that our textbook uses to illustrate the process
scheduling examples. Each simulation �le
contains multiple rows of data, where each row consists of the
process name, its arrival time, and its
service time. Here is an example:
1
12. A 0 3
B 2 6
C 4 4
D 6 5
E 8 2
This �le is named process-01.sim in the zip archive of �les I
have given you to get started on this
assignment. This is also the same set of processes and
start/service times used for all of the examples
in table 9.4 and �gure 9.5.
Running Simulations
As with previous assignments you are required to support using
your simulation from the command
line. Your program will take the name of the �le containing the
process information �rst. The next
parameter will be either 'rr' to perform round-robin scheduling,
or 'srt' if shortest remaining time policy
is to be simulated. Finally, a 3rd parameter will be supplied for
the round-robin scheduler, the time
slice quantum to use. An example of running your �nished
program should look like this:
$ ./p3 process-01.sim rr 4
A A A B B B B C C C C D D D D B B E E D
Name Fnsh T_r T_r/T_s
13. ----------------------
A 3 3 1
B 17 15 2.5
C 11 7 1.75
D 20 14 2.8
E 19 11 5.5
Here we are running the simulation using the set of process
information given in the previous section
and with a time slice quantum of 4.
Required Output
As shown above, your program must generate 2 bits of output.
First of all, while running the simulation
of the selected scheduling policy, you should display the
process names in the order they are run. In
the previous example, the sequence of scheduled/run processes
was:
A A A B B B B C C C C D D D D B B E E D
This indicates that process A ran �rst (times 0, 1 and 2),
followed by B running 4 times (times 3
to 7), etc. You are required to output the sequence of process
runs as the �rst line of output, with a
single space in between each process name as shown.
After the processes have run, you need to calculate and display
the statistics for the processes that
you just simulated. In our previous example, the statistics for
14. our round-robin simulation with a time
quantum of 4 time slices were:
Name Fnsh T_r T_r/T_s
----------------------
A 3 3 1
B 17 15 2.5
C 11 7 1.75
2
D 20 14 2.8
E 19 11 5.5
For each process, you need to output the time when it �nished,
the turnaround time (Tr) and the
ratio of the turnaround time to the service time (Tr/Ts).
I have provided a zip �le with a �le named p3-start.cpp as a
template to get you started. In addition,
I have provided you with two process simulation �les, named
process-01.sim and process-02.sim, with
2 sets of process information you can simulate. There are
several examples of correct results generated
for the two sets of inputs, named things like process-01-q1.res,
process-01-q4.res, process-01-srt.res, etc.
These are the correct results you should get for running your
simulation with round-robin scheduling
for various time quantums or for shortest remaining time
15. scheduling.
3
processtable-01.sim
A 0 3
B 2 6
C 4 4
D 6 5
E 8 2
processtable-02.sim
A 0 4
B 1 7
C 4 5
D 4 5
E 7 2
F 8 5
G 10 1
H 10 4
I 12 6
processtable-03.sim
A 0 3
B 2 4
C 3 5
D 3 8
E 3 2
F 5 6
G 7 9
H 7 4
I 8 3
18. sim-03-rr-1.res
sim-03-rr-5.res
sim-03-srt.res
Programming Assignment #5
CSci 430, Spring 2019
Dates:
Assigned: Monday April 15, 2019
Due: Wednesday May 1, 2019 (before Midnight)
Objectives:
� Understand short-term process scheduling.
� Work with data structures to implement a round-robin
scheduler.
� Look at e�ects of di�erent time slice quantum sizes on the
round-robin scheduling algorithm.
� Use C/C++ to implement vector and matrix data structures,
get practice in creating and using
such data structures in C/C++.
Description:
19. Our textbooks chapter 9 discusses several possible short-term
process scheduling policies. In this
programming assignment exercise we will implement two of the
preemptive policies, the simple shortest
remaining time policy (SRT) and the round-robin scheduler with
preemptive time slicing. Your program
will be given a simple input �le, indicating the process name,
its arrival time and its total service time,
the same as the process scheduling examples from our textbook
in Table 9.4 and Figure 9.5. You will
simulate the execution of the required schedulers. As in
previous assignments, you program will need
to work non-interactively and be callable from the command
line. The program will be provided with
the �le name of a �le with process information, in the format
discussed below. Your program will also
be given the time slicing quantum parameter it is to use for the
simulation, if round-robin scheduling
is selected. Your program will need to output the results of
running the set of simulated processes
using the selected scheduling policy with the indicated time
slice for the round-robin scheduler. Your
program will have to output its results exactly as shown below
in the required output format. Your
program will also need to calculate some summary statistics for
the simulated processes, including the
turnaround time and Tr/Ts ratio for each process, and the mean
Tr and Tr/Ts values for the given
simulation.
Process simulation �le formats
The �les with the information about the processes to be
simulated are fairly simple, and have the same
information that our textbook uses to illustrate the process
20. scheduling examples. Each simulation �le
contains multiple rows of data, where each row consists of the
process name, its arrival time, and its
service time. Here is an example:
1
A 0 3
B 2 6
C 4 4
D 6 5
E 8 2
This �le is named process-01.sim in the zip archive of �les I
have given you to get started on this
assignment. This is also the same set of processes and
start/service times used for all of the examples
in table 9.4 and �gure 9.5.
Running Simulations
As with previous assignments you are required to support using
your simulation from the command
line. Your program will take the name of the �le containing the
process information �rst. The next
parameter will be either 'rr' to perform round-robin scheduling,
or 'srt' if shortest remaining time policy
is to be simulated. Finally, a 3rd parameter will be supplied for
the round-robin scheduler, the time
slice quantum to use. An example of running your �nished
21. program should look like this:
$ ./p3 process-01.sim rr 4
A A A B B B B C C C C D D D D B B E E D
Name Fnsh T_r T_r/T_s
----------------------
A 3 3 1
B 17 15 2.5
C 11 7 1.75
D 20 14 2.8
E 19 11 5.5
Here we are running the simulation using the set of process
information given in the previous section
and with a time slice quantum of 4.
Required Output
As shown above, your program must generate 2 bits of output.
First of all, while running the simulation
of the selected scheduling policy, you should display the
process names in the order they are run. In
the previous example, the sequence of scheduled/run processes
was:
A A A B B B B C C C C D D D D B B E E D
This indicates that process A ran �rst (times 0, 1 and 2),
22. followed by B running 4 times (times 3
to 7), etc. You are required to output the sequence of process
runs as the �rst line of output, with a
single space in between each process name as shown.
After the processes have run, you need to calculate and display
the statistics for the processes that
you just simulated. In our previous example, the statistics for
our round-robin simulation with a time
quantum of 4 time slices were:
Name Fnsh T_r T_r/T_s
----------------------
A 3 3 1
B 17 15 2.5
C 11 7 1.75
2
D 20 14 2.8
E 19 11 5.5
For each process, you need to output the time when it �nished,
the turnaround time (Tr) and the
ratio of the turnaround time to the service time (Tr/Ts).
I have provided a zip �le with a �le named p3-start.cpp as a
template to get you started. In addition,
I have provided you with two process simulation �les, named
23. process-01.sim and process-02.sim, with
2 sets of process information you can simulate. There are
several examples of correct results generated
for the two sets of inputs, named things like process-01-q1.res,
process-01-q4.res, process-01-srt.res, etc.
These are the correct results you should get for running your
simulation with round-robin scheduling
for various time quantums or for shortest remaining time
scheduling.
3