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.
files/Heap.h
#ifndef HEAP_H
#define HEAP_H
#include <vector>
#include <stdexcept> // std::out_of_range
#include <math.h> // pow()
using namespace std;
template<typename T>
class Heap
{
private:
vector<T> _items; // Main vector of elements for heap storage
/**
* Used to take unsorted data and heapify it
*/
void buildHeap()
{
for (int i = _items.size() / 2; i >= 0; i--)
{
percolateDown(i);
}
}
/*********************************************************************/
/********************* Microassignment zone *************************/
/**
* Percolates the item specified at by index down
* into its proper location within a heap.
* Used for dequeue operations and array to heap conversions
* MA TODO: Implement percolateDown!
*/
void percolateDown(int index)
{
}
/**
* Percolate up from a given index to fix heap property
* Used in inserting new nodes into the heap
* MA TODO: Implement percolateUp
*/
void percolateUp( int current_position )
{
}
/************************** Microassigment zone DONE *********************/
public:
/**
* Default empty constructor
*/
Heap()
{
}
/**
* Constructor with a vector of elements
*/
Heap(const vector<T> &unsorted)
{
for (int i = 0; i < unsorted.size(); i++)
{
_items.push_back(unsorted[i]);
}
buildHeap();
}
/**
* Adds a new item to the heap
*/
void insert(T item)
{
int current_position = size(); // Get index location
_items.push_back(item); // Add data to end
percolateUp( current_position ); // Adjust up, as needed
}
/**
* Returns the top-most item in our heap without
* actually removing the item from the heap
*/
T& getFirst()
{
if( size() > 0 )
return _items[0];
else
throw std::out_of_range("No elements in Heap.");
}
/**
* Removes minimum value from heap and returns it to the caller
*/
T deleteMin()
{
int last_index = size() - 1; // Calc last item index
int root_index = 0; // Root index (for readability)
T min_item = _items[root_index]; // Keep item to return
_items[root_index] = _items[last_index]; // Move last item to root
_items.erase(_items.end() - 1); // Erase last element entry
percolateDown(0); // Fix heap property
return min_item;
}
/**
* Returns true if heap is empty, else false
*/
bool isEmpty() const
{
return _items.size() == 0;
}
/**
* Returns current quantity of elements in heap (N)
*/
int size() const
{
return _items.size();
}
/**
* Return heap data in order from the _items vector
*/
string to_s() const
{
string ret = "";
for(int i = 0; i < _items.size(); i++)
{
ret += to_string(_items[i]) + " ";
}
return ret;
}
/**
...
#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 << ...
A C++ program //include headers; these are modules that include functions that you may use in your //program; we will almost always need to include the header that // defines cin and cout; the header is called iostream.h #include <iostream.h>
int main() {
//variable declaration //read values input from user //computation and print output to user return 0; }
After you write a C++ program you compile it; that is, you run a program called compiler that checks whether the program follows the C++ syntax – if it finds errors, it lists them – If there are no errors, it translates the C++ program into a program in machine language which you can execute.
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.
files/Heap.h
#ifndef HEAP_H
#define HEAP_H
#include <vector>
#include <stdexcept> // std::out_of_range
#include <math.h> // pow()
using namespace std;
template<typename T>
class Heap
{
private:
vector<T> _items; // Main vector of elements for heap storage
/**
* Used to take unsorted data and heapify it
*/
void buildHeap()
{
for (int i = _items.size() / 2; i >= 0; i--)
{
percolateDown(i);
}
}
/*********************************************************************/
/********************* Microassignment zone *************************/
/**
* Percolates the item specified at by index down
* into its proper location within a heap.
* Used for dequeue operations and array to heap conversions
* MA TODO: Implement percolateDown!
*/
void percolateDown(int index)
{
}
/**
* Percolate up from a given index to fix heap property
* Used in inserting new nodes into the heap
* MA TODO: Implement percolateUp
*/
void percolateUp( int current_position )
{
}
/************************** Microassigment zone DONE *********************/
public:
/**
* Default empty constructor
*/
Heap()
{
}
/**
* Constructor with a vector of elements
*/
Heap(const vector<T> &unsorted)
{
for (int i = 0; i < unsorted.size(); i++)
{
_items.push_back(unsorted[i]);
}
buildHeap();
}
/**
* Adds a new item to the heap
*/
void insert(T item)
{
int current_position = size(); // Get index location
_items.push_back(item); // Add data to end
percolateUp( current_position ); // Adjust up, as needed
}
/**
* Returns the top-most item in our heap without
* actually removing the item from the heap
*/
T& getFirst()
{
if( size() > 0 )
return _items[0];
else
throw std::out_of_range("No elements in Heap.");
}
/**
* Removes minimum value from heap and returns it to the caller
*/
T deleteMin()
{
int last_index = size() - 1; // Calc last item index
int root_index = 0; // Root index (for readability)
T min_item = _items[root_index]; // Keep item to return
_items[root_index] = _items[last_index]; // Move last item to root
_items.erase(_items.end() - 1); // Erase last element entry
percolateDown(0); // Fix heap property
return min_item;
}
/**
* Returns true if heap is empty, else false
*/
bool isEmpty() const
{
return _items.size() == 0;
}
/**
* Returns current quantity of elements in heap (N)
*/
int size() const
{
return _items.size();
}
/**
* Return heap data in order from the _items vector
*/
string to_s() const
{
string ret = "";
for(int i = 0; i < _items.size(); i++)
{
ret += to_string(_items[i]) + " ";
}
return ret;
}
/**
...
#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 << ...
A C++ program //include headers; these are modules that include functions that you may use in your //program; we will almost always need to include the header that // defines cin and cout; the header is called iostream.h #include <iostream.h>
int main() {
//variable declaration //read values input from user //computation and print output to user return 0; }
After you write a C++ program you compile it; that is, you run a program called compiler that checks whether the program follows the C++ syntax – if it finds errors, it lists them – If there are no errors, it translates the C++ program into a program in machine language which you can execute.
Instruction1. Please read the two articles. (Kincheloe part 1 &.docxcarliotwaycave
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 ...
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.
Project 5Programming and Algorithms IICSCI 211, Spring 2.docxbriancrawford30935
Project 5
Programming and Algorithms II
CSCI 211, Spring 2018
Objectives
• Implement a Priority Queue
• Practice using a struct
• Practice command line arguments
• Practice using file streams
• Practice assert(·)
• Deploy multiple instances of your priority queue
Protip: The priority queue used in this assignment is created in Lab 8. Follow those
instruction to create and test your Pqueue.
Overview
Write a program to simulate the daily operations of a Kwik-E-Mart.
1
There are two types of customers, those that buy things (shoppers), and those that steal
things and money (robbers).
Your program will:
1. read in a list of customers
(name, shopper/robber, arrival time, number of items to buy/steal)
2. run the simulation
Output will be generated while the simulation is running.
Customers will enter the store at a specified arrival time, spend time shopping for their items,
get in line to pay/steal (our robbers are very polite, they wait in line to rob the store), spend
some time paying or stealing money, and then leave the store. When a customer performs
an action (arrive in store, get in checkout line, start paying/stealing, finish paying/stealing)
your program will print a message documenting the customer’s action and the current time.
Protip: Start early and work daily.
Program Requirements
Implementation
Your program must take four command line arguments: number of checkers, length of
checker’s break after a robbery, name of input file, and name of output file. Your pro-
gram must check that the number of checkers is 1 or greater, the checker’s break length is 0
or greater, and that the input file and output files can be opened. If there is an error with a
command line argument, write to standard error (cerr) the appropriate message from the
following list and exit the program with an exit status of 1. Check for errors in the following
order. Exit the program after finding a single error (don’t look for all possible errors, stop
after one):
Error: invalid number of command line arguments.
Error: could not open input file <t01.in>.
Error: could not open output file <t01.out>.
Error: invalid number of checkers specified.
Error: invalid checker break duration specified.
In the above, replace <t01.in> and <t01.out> with the appropriate file names based on
the given arguments.
2
Time will be represented by a single integer starting at 1. In the loop below the variable
clock is used to store the current time.
The input file will be arbitrarily ordered and will have the format:
<name> <shopper/robber> <arrival time> <number of items to purchase/steal>
Homer shopper 3 9
Bart shopper 5 23
Lisa shopper 2 12
Maggie robber 27 1
Names will be a single string without any spaces.
Type of customer will always be either “shopper” or “robber”.
Arrival time will be an integer greater than 0.
Number of items will be an integer greater than 0.
Output
An output message must be printed every time a customer:
1. enters the stor.
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyGrejoJoby1
The slides from the C++ and OOPS Crash Course conducted for ACM DBIT by Grejo Joby.
Learn the concepts of OOPS and C++ Programming in the shortest time with these notes.
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdfaassecuritysystem
C++ Language
** Dynamic Memory **
There are 7 files in this project, and they are down below. And I guess the professor wants us to
modify the set.cpp make sure the numbers are entered by the user to be set dynamically. If you
pay attention to the set.cpp I marked in bold a section that may be needed to be changed. I have
put all the codes down so that you can copy them to your computer to have an idea of how they
work together. Only that Set.cpp must be modified so the number of elements can be set
dynamically during the program's execution. And please can you be more specific about what
line of code needs to be replaced?
Here are the professor's instructions.
** Note: The goal of this assignment is to MODIFY the existing code. **
Implement a dynamically allocated version of the mathematical concept of a 'set'. First, examine
the provided library and driver (in main) for a statically allocated Set class. You may also want
to refresh your mathematical memory of the set concept before proceeding.
Now that you are familiar with how the Set class works, let's make it work better. Currently, the
user is limited to a certain maximum number of elements in their Set. Change it so the number of
elements can be set dynamically during the program's execution.
Extend the driver to test all the ADT's operations.
** Things to Consider **
1. If your set is implemented in dynamic memory:
1a. How do you access the members?
1b. How and when do you re-size the memory?
HERE are the CODE files:.
main.cpp
include <iostream>
#include <cctype>
#include "input.h"
#include "set.h"
using namespace std;
int main(void)
{
Set x, y, z;
bool quit;
long newone;
do
{
cout << "Enter a long integer: ";
cin >> newone;
if (x.ismember(newone))
{
cout << "You've already entered that!" << endl;
}
else
{
x.add_elem(newone);
cout << "Value added to list!" << endl;
}
quit = toupper(get_in_set("YyNn", "Would you like to enter more? ")) == 'N';
} while (!quit && !x.full());
cout << "Overall, you entered: " << endl;
x.output(cout);
cout << endl;
cout << "Please enter a set of long integers: ";
x.input(cin);
cout << endl << "You entered:\n";
x.output(cout);
cout << endl;
cout << "Please enter another set of long integers: ";
y.input(cin);
cout << endl << "You entered:\n";
y.output(cout);
cout << endl;
cout << "The union of the two sets is:\n";
z = x;
z.union_with(y);
z.output(cout);
cout << endl;
cout << "The intersection of the two sets is:\n";
z = x;
z.intersection(y);
z.output(cout);
cout << endl;
return 0;
}
input.cpp
#include "input.h"
#include <iostream>
#include <cstring>
#include <cctype>
using namespace std;
// Boundaries are assumed to be solid -- low <= value <= high.
// Enum to say which end is to be bounded...
//
// enum BoundType { Low, High, Both };
// Bounded entry function for long integers...
//
long get_bounded(long low,
long high,
const char prompt[] /* = "Enter bounded value: " */,
BoundType which_end /* = Both */)
{
long value;
cout << prompt;
cin >> value;
while (((.
I need help to modify my code according to the instructions- Modify th.pdfpnaran46
I need help to modify my code according to the instructions:
Modify the program you created in Lab Assignment #9 (Babbage's Cabbage's, Part 3) to include
the following features:
Use parallel arrays to store the full name and gross pay of all employees entered. The size of the
arrays must be easy to change using a single symbolic constant. At the end of the program, after
all the individual employee records have been input and processed, write a summary table to the
report file listing the employees entered and their gross pay amounts. See the sample report that
follows for an example. (Your program may only store these two specific pieces of employee
data in arrays. You will not earn credit for this feature if you create additional arrays for other
pieces of employee data.)
Create individual functions for computing the sum of the gross pay amounts, the average, finding
the maximum gross pay, and the minimum gross pay. Each of these four functions can accept
only the array of gross pay amounts and number of valid data items as parameters, and cannot
depend on the array being arranged in order. Display the total, average, minimum, and maximum
of the gross pay amounts in the report file summary.
Use the optimized version of the Bubble Sort (v.3) so that the summary table of employee names
and gross pay amounts is arranged in descending order by gross pay.
Read input from a data file, rather than the user. See the sample data file that follows for an
example (note that the amount of the transportation deduction is supplied directly). You may
assume that all data provided in the file is valid. Remove all code related to keyboard input and
data validation so that the program simply reads from the data file and writes to the report file
without needing any input from the user.
Sample Report File
Submissions whose programs do not compile without errors, do not use a modular style (i.e., all
of the program code appears in the main module), or contain any of the items listed below, will
receive a grade of zero:
Global variables, Recursive module calls, vectors, structs, or classes, The line using namespace
std; Inclusion of libraries that have not been introduced as part of the class (including those that
are specific to a particular operating system), or use of their commands, Calls to the system
function
This is my code that needs to be modified:
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include <ostream>
#define min_hours 10.0
#define max_hours 55.0
#define min_hourly_rate 15.00
#define max_hourly_rate 65.00
#define overtime_limit 34.0
void input_employee_data(double &hours_worked, double &hourly_wage);
void calculate_gross_pay(double &hours_worked, double &hourly_wage, double& ovt_hours,
double& reg_hours, double &gross_pay);
void calculate_net_pay(double &gross_pay, double& deduct, double &net_pay, double &taxes);
std::string input_full_name(std::string& first_name,
std::string& last_name);
std::string join_names.
I have written the code but cannot complete the assignment please help.pdfshreeaadithyaacellso
I have written the code but cannot complete the assignment please help me to complete.
Please don't just copy other s answers as your own.
// Insertion sort
/*
#include <ctime>
#include <iostream>
using namespace std;
void insertionSort(int arr[], int n) {
int i, key, j;
for (i = 1; i < n; i++) {
key = arr[i];
j = i - 1;
// Move elements of arr[0..i-1], that are greater than key, to one position ahead of their current
position
while (j >= 0 && arr[j] > key) {
arr[j + 1] = arr[j];
j = j - 1;
}
arr[j + 1] = key;
}
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int num = sizeof(arr) / sizeof(arr[0]);
clock_t start, end;
double timetaken;
start = clock();
insertionSort(arr, num);
end = clock();
cout << "Sorted array: \n";
for (int i = 0; i < n; i++)
cout << arr[i] << " ";
cout << endl;
timetaken = ((double) (end - start)) / CLOCKS_PER_SEC;
cout << "Time taken : " << fixed << timetaken << "s" << endl;
return 0;
}
*/
// Shell Sort
/*
#include <ctime>
#include <iostream>
using namespace std;
int shellSort(int arr[], int n) {
for (int gap = n/2; gap > 0; gap /= 2) {
for (int i = gap; i < n; i += 1) {
int temp = arr[i];
int j;
for (j = i; j >= gap && arr[j - gap] > temp; j -= gap)
arr[j] = arr[j - gap];
arr[j] = temp;
}
}
return 0;
}
void printArray(int arr[], int n) {
for (int i=0; i<n; i++)
cout << arr[i] << " ";
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int num = sizeof(arr) / sizeof(arr[0]);
clock_t start, end;
double timetaken;
start = clock();
shellSort(arr, num);
end = clock();
cout << "\nArray after sorting: \n";
printArray(arr, n);
cout << endl;
timetaken = (double)(end - start) / CLOCKS_PER_SEC;
cout << "Time taken : " << fixed << timetaken << "s" << endl;
return 0;
}
*/
// MergeSort
/*
#include <ctime>
#include <iostream>
using namespace std;
void merge(int arr[], int l, int m, int r) {
int i, j, k;
int n1 = m - l + 1;
int n2 = r - m;
int L[n1], R[n2];
for (i = 0; i < n1; i++)
L[i] = arr[l + i];
for (j = 0; j < n2; j++)
R[j] = arr[m + 1 + j];
i = 0;
j = 0;
k = l;
while (i < n1 && j < n2) {
if (L[i] <= R[j]) {
arr[k] = L[i];
i++;
}
else {
arr[k] = R[j];
j++;
}
k++;
}
while (i < n1) {
arr[k] = L[i];
i++;
k++;
}
while (j < n2) {
arr[k] = R[j];
j++;
k++;
}
}
void mergeSort(int arr[], int l, int r) {
if (l < r) {
int m = l + (r - l) / 2;
mergeSort(arr, l, m);
mergeSort(arr, m + 1, r);
merge(arr, l, m, r);
}
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int arr_size = sizeof(arr) / sizeof(arr[0]);
clock_t start;
clock_t end;
double timetaken;
start = clock();
mergeSort(arr, 0, arr_size - 1);
end = clock();
timetaken = (double)(end - start) / CLOCKS_PER_SEC;
.
(APA 6th Edition Formatting and Style Guide)
Office of Graduate Studies
Alcorn State University
Engaging Possibilities, Pursuing Excellence
REVISED May 23, 2018
THESIS MANUAL
Graduates
2
COPYRIGHT PRIVILEGES
BELONG TO
OFFICE OF GRADUATE STUDIES
ALCORN STATE UNIVERSITY, LORMAN, MS
Reproduction for distribution of this THESIS MANUAL requires the written permission of the
Provost and Executive Vice President for Academic Affairs or Graduate Studies Administrator.
FOREWORD
Alcorn State University Office of Graduate Studies requires that all students comply with the
specifications given in this document in the publication of a thesis or non-thesis research project.
Graduate students, under faculty guidance, are expected to produce scholarly work either in the
form of a thesis or a scholarly research project.
The thesis (master or specialist) should document the student's research study and maintain a
degree of intensity.
The purpose of this manual is to assist the graduate student and the graduate thesis advisory
committee in each department with the instructions contained herein. This is the official
approved manual by the Graduate Division.
Formatting questions not addressed in these guidelines should be directed to the Graduate School
staff in the Walter Washington Administration Building, Suite 519 or by phone at
601.877.6122 or via email: [email protected] or in person.
The Graduate Studies
Thesis Advisory Committee
(Revised Spring 2018)
mailto:[email protected]
TABLE OF CONTENTS
Page
INTRODUCTION ............................................................................................................................ 3
SELECTION AND APPOINTMENT OF THESIS ADVISORY COMMITTEE ......................... 4
1. Early Topic Selection ......................................................................................................... 4
2. Selection of Thesis Chair ......................................................................................................... 4
3. Selection of Thesis Committee Members .......................................................................... 4
4. Appointment of Thesis Advisory Committee Form .......................................................... 4
5. Invitation to Prospective Committee Members ................................................................. 5
6. TAC Committee Selection ................................................................................................. 5
CHOICE OF SUBJECT .................................................................................................................... 5
PROPOSAL DEFENSE AND SUBMISSION OF PROPOSAL TO IRB ..................................... 5
PARTS OF THE MANUSCRIPT: PRELIMINARY PAGES ..................................................... 8
1. Title Page .
(a) Thrasymachus’ (the sophist’s) definition of Justice or Right o.docxAASTHA76
(a) Thrasymachus’ (the sophist’s) definition of Justice or Right or Right Doing/Living is “The Interest of the Stronger (Might makes Right).” How does Socrates refute this definition? (cite just
one
of his arguments) [cf:
The Republic
, 30-40, Unit 1 Lecture Video]
(b) According to Socrates, what is the true definition of Justice or Right? [cf:
The Republic
, 141-42, Unit 2 Lecture Video]
(c) And why therefore is the Just life far preferable to the Unjust life (142-43)?
(a) The Allegory of the CAVE (the main metaphor of western philosophy) is an illustration of the Divided LINE.
Characterize
the Two Worlds, and the move/ascent from one to the other (exiting the CAVE, crossing the Divided LINE)—which is alone the true meaning of Education and the only way to become Just, Right, and Immortal. [cf:
The Republic
, 227-232, Unit 3 Lecture Video]
(b) How do the philosophical Studies of
Arithmetic
(number) and
Dialectic
take you above the Divided Line and out of the changing sense-world of illusion (the CAVE) into Reality and make you use your Reason (pure thought) instead of your senses? [cf:
The Republic
, 235-37, 240-42, 250-55. Unit 4 Lecture Video (transcript)]
Give a summary of the
Proof of the Force
(Why there is the “Universe,” “Man,” “God,” “History,” etc)? Start with, “Can there be
nothing
?” [cf: TJH 78-95, Unit 2 Lecture Video]
NIETZSCHE is the crucial Jedi philosopher who provides the “bridge” between negative and positive Postmodernity by focusing on a certain “Problem” and the “
Solution
” to it.
(a) Discuss
2
of the following items (
1
pertaining to the Problem,
1
pertaining to the
.
More Related Content
Similar to #include customer.h#include heap.h#include iostream.docx
Instruction1. Please read the two articles. (Kincheloe part 1 &.docxcarliotwaycave
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 ...
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.
Project 5Programming and Algorithms IICSCI 211, Spring 2.docxbriancrawford30935
Project 5
Programming and Algorithms II
CSCI 211, Spring 2018
Objectives
• Implement a Priority Queue
• Practice using a struct
• Practice command line arguments
• Practice using file streams
• Practice assert(·)
• Deploy multiple instances of your priority queue
Protip: The priority queue used in this assignment is created in Lab 8. Follow those
instruction to create and test your Pqueue.
Overview
Write a program to simulate the daily operations of a Kwik-E-Mart.
1
There are two types of customers, those that buy things (shoppers), and those that steal
things and money (robbers).
Your program will:
1. read in a list of customers
(name, shopper/robber, arrival time, number of items to buy/steal)
2. run the simulation
Output will be generated while the simulation is running.
Customers will enter the store at a specified arrival time, spend time shopping for their items,
get in line to pay/steal (our robbers are very polite, they wait in line to rob the store), spend
some time paying or stealing money, and then leave the store. When a customer performs
an action (arrive in store, get in checkout line, start paying/stealing, finish paying/stealing)
your program will print a message documenting the customer’s action and the current time.
Protip: Start early and work daily.
Program Requirements
Implementation
Your program must take four command line arguments: number of checkers, length of
checker’s break after a robbery, name of input file, and name of output file. Your pro-
gram must check that the number of checkers is 1 or greater, the checker’s break length is 0
or greater, and that the input file and output files can be opened. If there is an error with a
command line argument, write to standard error (cerr) the appropriate message from the
following list and exit the program with an exit status of 1. Check for errors in the following
order. Exit the program after finding a single error (don’t look for all possible errors, stop
after one):
Error: invalid number of command line arguments.
Error: could not open input file <t01.in>.
Error: could not open output file <t01.out>.
Error: invalid number of checkers specified.
Error: invalid checker break duration specified.
In the above, replace <t01.in> and <t01.out> with the appropriate file names based on
the given arguments.
2
Time will be represented by a single integer starting at 1. In the loop below the variable
clock is used to store the current time.
The input file will be arbitrarily ordered and will have the format:
<name> <shopper/robber> <arrival time> <number of items to purchase/steal>
Homer shopper 3 9
Bart shopper 5 23
Lisa shopper 2 12
Maggie robber 27 1
Names will be a single string without any spaces.
Type of customer will always be either “shopper” or “robber”.
Arrival time will be an integer greater than 0.
Number of items will be an integer greater than 0.
Output
An output message must be printed every time a customer:
1. enters the stor.
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyGrejoJoby1
The slides from the C++ and OOPS Crash Course conducted for ACM DBIT by Grejo Joby.
Learn the concepts of OOPS and C++ Programming in the shortest time with these notes.
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdfaassecuritysystem
C++ Language
** Dynamic Memory **
There are 7 files in this project, and they are down below. And I guess the professor wants us to
modify the set.cpp make sure the numbers are entered by the user to be set dynamically. If you
pay attention to the set.cpp I marked in bold a section that may be needed to be changed. I have
put all the codes down so that you can copy them to your computer to have an idea of how they
work together. Only that Set.cpp must be modified so the number of elements can be set
dynamically during the program's execution. And please can you be more specific about what
line of code needs to be replaced?
Here are the professor's instructions.
** Note: The goal of this assignment is to MODIFY the existing code. **
Implement a dynamically allocated version of the mathematical concept of a 'set'. First, examine
the provided library and driver (in main) for a statically allocated Set class. You may also want
to refresh your mathematical memory of the set concept before proceeding.
Now that you are familiar with how the Set class works, let's make it work better. Currently, the
user is limited to a certain maximum number of elements in their Set. Change it so the number of
elements can be set dynamically during the program's execution.
Extend the driver to test all the ADT's operations.
** Things to Consider **
1. If your set is implemented in dynamic memory:
1a. How do you access the members?
1b. How and when do you re-size the memory?
HERE are the CODE files:.
main.cpp
include <iostream>
#include <cctype>
#include "input.h"
#include "set.h"
using namespace std;
int main(void)
{
Set x, y, z;
bool quit;
long newone;
do
{
cout << "Enter a long integer: ";
cin >> newone;
if (x.ismember(newone))
{
cout << "You've already entered that!" << endl;
}
else
{
x.add_elem(newone);
cout << "Value added to list!" << endl;
}
quit = toupper(get_in_set("YyNn", "Would you like to enter more? ")) == 'N';
} while (!quit && !x.full());
cout << "Overall, you entered: " << endl;
x.output(cout);
cout << endl;
cout << "Please enter a set of long integers: ";
x.input(cin);
cout << endl << "You entered:\n";
x.output(cout);
cout << endl;
cout << "Please enter another set of long integers: ";
y.input(cin);
cout << endl << "You entered:\n";
y.output(cout);
cout << endl;
cout << "The union of the two sets is:\n";
z = x;
z.union_with(y);
z.output(cout);
cout << endl;
cout << "The intersection of the two sets is:\n";
z = x;
z.intersection(y);
z.output(cout);
cout << endl;
return 0;
}
input.cpp
#include "input.h"
#include <iostream>
#include <cstring>
#include <cctype>
using namespace std;
// Boundaries are assumed to be solid -- low <= value <= high.
// Enum to say which end is to be bounded...
//
// enum BoundType { Low, High, Both };
// Bounded entry function for long integers...
//
long get_bounded(long low,
long high,
const char prompt[] /* = "Enter bounded value: " */,
BoundType which_end /* = Both */)
{
long value;
cout << prompt;
cin >> value;
while (((.
I need help to modify my code according to the instructions- Modify th.pdfpnaran46
I need help to modify my code according to the instructions:
Modify the program you created in Lab Assignment #9 (Babbage's Cabbage's, Part 3) to include
the following features:
Use parallel arrays to store the full name and gross pay of all employees entered. The size of the
arrays must be easy to change using a single symbolic constant. At the end of the program, after
all the individual employee records have been input and processed, write a summary table to the
report file listing the employees entered and their gross pay amounts. See the sample report that
follows for an example. (Your program may only store these two specific pieces of employee
data in arrays. You will not earn credit for this feature if you create additional arrays for other
pieces of employee data.)
Create individual functions for computing the sum of the gross pay amounts, the average, finding
the maximum gross pay, and the minimum gross pay. Each of these four functions can accept
only the array of gross pay amounts and number of valid data items as parameters, and cannot
depend on the array being arranged in order. Display the total, average, minimum, and maximum
of the gross pay amounts in the report file summary.
Use the optimized version of the Bubble Sort (v.3) so that the summary table of employee names
and gross pay amounts is arranged in descending order by gross pay.
Read input from a data file, rather than the user. See the sample data file that follows for an
example (note that the amount of the transportation deduction is supplied directly). You may
assume that all data provided in the file is valid. Remove all code related to keyboard input and
data validation so that the program simply reads from the data file and writes to the report file
without needing any input from the user.
Sample Report File
Submissions whose programs do not compile without errors, do not use a modular style (i.e., all
of the program code appears in the main module), or contain any of the items listed below, will
receive a grade of zero:
Global variables, Recursive module calls, vectors, structs, or classes, The line using namespace
std; Inclusion of libraries that have not been introduced as part of the class (including those that
are specific to a particular operating system), or use of their commands, Calls to the system
function
This is my code that needs to be modified:
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include <ostream>
#define min_hours 10.0
#define max_hours 55.0
#define min_hourly_rate 15.00
#define max_hourly_rate 65.00
#define overtime_limit 34.0
void input_employee_data(double &hours_worked, double &hourly_wage);
void calculate_gross_pay(double &hours_worked, double &hourly_wage, double& ovt_hours,
double& reg_hours, double &gross_pay);
void calculate_net_pay(double &gross_pay, double& deduct, double &net_pay, double &taxes);
std::string input_full_name(std::string& first_name,
std::string& last_name);
std::string join_names.
I have written the code but cannot complete the assignment please help.pdfshreeaadithyaacellso
I have written the code but cannot complete the assignment please help me to complete.
Please don't just copy other s answers as your own.
// Insertion sort
/*
#include <ctime>
#include <iostream>
using namespace std;
void insertionSort(int arr[], int n) {
int i, key, j;
for (i = 1; i < n; i++) {
key = arr[i];
j = i - 1;
// Move elements of arr[0..i-1], that are greater than key, to one position ahead of their current
position
while (j >= 0 && arr[j] > key) {
arr[j + 1] = arr[j];
j = j - 1;
}
arr[j + 1] = key;
}
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int num = sizeof(arr) / sizeof(arr[0]);
clock_t start, end;
double timetaken;
start = clock();
insertionSort(arr, num);
end = clock();
cout << "Sorted array: \n";
for (int i = 0; i < n; i++)
cout << arr[i] << " ";
cout << endl;
timetaken = ((double) (end - start)) / CLOCKS_PER_SEC;
cout << "Time taken : " << fixed << timetaken << "s" << endl;
return 0;
}
*/
// Shell Sort
/*
#include <ctime>
#include <iostream>
using namespace std;
int shellSort(int arr[], int n) {
for (int gap = n/2; gap > 0; gap /= 2) {
for (int i = gap; i < n; i += 1) {
int temp = arr[i];
int j;
for (j = i; j >= gap && arr[j - gap] > temp; j -= gap)
arr[j] = arr[j - gap];
arr[j] = temp;
}
}
return 0;
}
void printArray(int arr[], int n) {
for (int i=0; i<n; i++)
cout << arr[i] << " ";
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int num = sizeof(arr) / sizeof(arr[0]);
clock_t start, end;
double timetaken;
start = clock();
shellSort(arr, num);
end = clock();
cout << "\nArray after sorting: \n";
printArray(arr, n);
cout << endl;
timetaken = (double)(end - start) / CLOCKS_PER_SEC;
cout << "Time taken : " << fixed << timetaken << "s" << endl;
return 0;
}
*/
// MergeSort
/*
#include <ctime>
#include <iostream>
using namespace std;
void merge(int arr[], int l, int m, int r) {
int i, j, k;
int n1 = m - l + 1;
int n2 = r - m;
int L[n1], R[n2];
for (i = 0; i < n1; i++)
L[i] = arr[l + i];
for (j = 0; j < n2; j++)
R[j] = arr[m + 1 + j];
i = 0;
j = 0;
k = l;
while (i < n1 && j < n2) {
if (L[i] <= R[j]) {
arr[k] = L[i];
i++;
}
else {
arr[k] = R[j];
j++;
}
k++;
}
while (i < n1) {
arr[k] = L[i];
i++;
k++;
}
while (j < n2) {
arr[k] = R[j];
j++;
k++;
}
}
void mergeSort(int arr[], int l, int r) {
if (l < r) {
int m = l + (r - l) / 2;
mergeSort(arr, l, m);
mergeSort(arr, m + 1, r);
merge(arr, l, m, r);
}
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int arr_size = sizeof(arr) / sizeof(arr[0]);
clock_t start;
clock_t end;
double timetaken;
start = clock();
mergeSort(arr, 0, arr_size - 1);
end = clock();
timetaken = (double)(end - start) / CLOCKS_PER_SEC;
.
Similar to #include customer.h#include heap.h#include iostream.docx (20)
(APA 6th Edition Formatting and Style Guide)
Office of Graduate Studies
Alcorn State University
Engaging Possibilities, Pursuing Excellence
REVISED May 23, 2018
THESIS MANUAL
Graduates
2
COPYRIGHT PRIVILEGES
BELONG TO
OFFICE OF GRADUATE STUDIES
ALCORN STATE UNIVERSITY, LORMAN, MS
Reproduction for distribution of this THESIS MANUAL requires the written permission of the
Provost and Executive Vice President for Academic Affairs or Graduate Studies Administrator.
FOREWORD
Alcorn State University Office of Graduate Studies requires that all students comply with the
specifications given in this document in the publication of a thesis or non-thesis research project.
Graduate students, under faculty guidance, are expected to produce scholarly work either in the
form of a thesis or a scholarly research project.
The thesis (master or specialist) should document the student's research study and maintain a
degree of intensity.
The purpose of this manual is to assist the graduate student and the graduate thesis advisory
committee in each department with the instructions contained herein. This is the official
approved manual by the Graduate Division.
Formatting questions not addressed in these guidelines should be directed to the Graduate School
staff in the Walter Washington Administration Building, Suite 519 or by phone at
601.877.6122 or via email: [email protected] or in person.
The Graduate Studies
Thesis Advisory Committee
(Revised Spring 2018)
mailto:[email protected]
TABLE OF CONTENTS
Page
INTRODUCTION ............................................................................................................................ 3
SELECTION AND APPOINTMENT OF THESIS ADVISORY COMMITTEE ......................... 4
1. Early Topic Selection ......................................................................................................... 4
2. Selection of Thesis Chair ......................................................................................................... 4
3. Selection of Thesis Committee Members .......................................................................... 4
4. Appointment of Thesis Advisory Committee Form .......................................................... 4
5. Invitation to Prospective Committee Members ................................................................. 5
6. TAC Committee Selection ................................................................................................. 5
CHOICE OF SUBJECT .................................................................................................................... 5
PROPOSAL DEFENSE AND SUBMISSION OF PROPOSAL TO IRB ..................................... 5
PARTS OF THE MANUSCRIPT: PRELIMINARY PAGES ..................................................... 8
1. Title Page .
(a) Thrasymachus’ (the sophist’s) definition of Justice or Right o.docxAASTHA76
(a) Thrasymachus’ (the sophist’s) definition of Justice or Right or Right Doing/Living is “The Interest of the Stronger (Might makes Right).” How does Socrates refute this definition? (cite just
one
of his arguments) [cf:
The Republic
, 30-40, Unit 1 Lecture Video]
(b) According to Socrates, what is the true definition of Justice or Right? [cf:
The Republic
, 141-42, Unit 2 Lecture Video]
(c) And why therefore is the Just life far preferable to the Unjust life (142-43)?
(a) The Allegory of the CAVE (the main metaphor of western philosophy) is an illustration of the Divided LINE.
Characterize
the Two Worlds, and the move/ascent from one to the other (exiting the CAVE, crossing the Divided LINE)—which is alone the true meaning of Education and the only way to become Just, Right, and Immortal. [cf:
The Republic
, 227-232, Unit 3 Lecture Video]
(b) How do the philosophical Studies of
Arithmetic
(number) and
Dialectic
take you above the Divided Line and out of the changing sense-world of illusion (the CAVE) into Reality and make you use your Reason (pure thought) instead of your senses? [cf:
The Republic
, 235-37, 240-42, 250-55. Unit 4 Lecture Video (transcript)]
Give a summary of the
Proof of the Force
(Why there is the “Universe,” “Man,” “God,” “History,” etc)? Start with, “Can there be
nothing
?” [cf: TJH 78-95, Unit 2 Lecture Video]
NIETZSCHE is the crucial Jedi philosopher who provides the “bridge” between negative and positive Postmodernity by focusing on a certain “Problem” and the “
Solution
” to it.
(a) Discuss
2
of the following items (
1
pertaining to the Problem,
1
pertaining to the
.
(Glossary of Telemedicine and eHealth)· Teleconsultation Cons.docxAASTHA76
(Glossary of Telemedicine and eHealth)
· Teleconsultation: Consultation between a provider and specialist at distance using either store and forward telemedicine or real time videoconferencing.
· Telehealth and Telemedicine: Telemedicine is the use of medical information exchanged from one site to another via electronic communications to improve patients' health status. Closely associated with telemedicine is the term "telehealth," which is often used to encompass a broader definition of remote healthcare that does not always involve clinical services. Videoconferencing, transmission of still images, e-health including patient portals, remote monitoring of vital signs, continuing medical education and nursing call centers are all considered part of telemedicine and telehealth. Telemedicine is not a separate medical specialty. Products and services related to telemedicine are often part of a larger investment by health care institutions in either information technology or the delivery of clinical care. Even in the reimbursement fee structure, there is usually no distinction made between services provided on site and those provided through telemedicine and often no separate coding required for billing of remote services. Telemedicine encompasses different types of programs and services provided for the patient. Each component involves different providers and consumers.
· TeleICU: TeleICU is a collaborative, interprofessional model focusing on the care of critically ill patients using telehealth technologies.
· Telemonitoring: The process of using audio, video, and other telecommunications and electronic information processing technologies to monitor the health status of a patient from a distance.
· Telemonitoring: The process of using audio, video, and other telecommunications and electronic information processing technologies to monitor the health status of a patient from a distance.
· Clinical Decision Support System (CCDS): Systems (usually electronically based and interactive) that provide clinicians, staff, patients, and other individuals with knowledge and person-specific information, intelligently filtered and presented at appropriate times, to enhance health and health care. (http://healthit.ahrq.gov/images/jun09cdsreview/09_0069_ef.html)
· e-Prescribing: The electronic generation, transmission and filling of a medical prescription, as opposed to traditional paper and faxed prescriptions. E-prescribing allows for qualified healthcare personnel to transmit a new prescription or renewal authorization to a community or mail-order pharmacy.
· Home Health Care and Remote Monitoring Systems: Care provided to individuals and families in their place of residence for promoting, maintaining, or restoring health or for minimizing the effects of disability and illness, including terminal illness. In the Medicare Current Beneficiary Survey and Medicare claims and enrollment data, home health care refers to home visits by professionals including nu.
(Assmt 1; Week 3 paper) Using ecree Doing the paper and s.docxAASTHA76
(Assmt 1; Week 3 paper): Using ecree Doing the paper and submitting it (two pages here)
Have this sheet handy as well as the sheet called FORMAT SAMPLE PAPER for Assignment 1.
1. Go to the Week 3 unit and find the blue link ASSIGNMENT 1: DEALING WITH DIVERSITY…. Click on it.
2. You will see instructions on the screen and at the top “Assignment 1: ecree”. Click on that to enter ecree.
3. You will see some summary of the assignment instructions at the top of the screen—scroll down to see the three long, blank, rectangular boxes. You will be typing into those. Remember—do not worry about a title page or double spacing. Start composing your paragraphs. It will start as a rough draft.
4. As you start typing your introduction—notice on the right that comments start developing and also video links. Also on the right you will it say “Saved a Few seconds ago”. It is saving as you go. At first the comments are red (unfavorable). The more you do, usually the more green (favorable) comments start to appear. You can also keep revising.
5. When you hit the enter key it takes you to the next paragraph box—and sometimes it creates a new paragraph box for you.
6. Doing your Sources list in ecree—Your sources do have to be listed at the end. The FORMAT SAMPLE paper illustrates what they might look like. But, putting them in ecree gracefully can be a challenge.
a. Perhaps the best way is this: Have the last regular paragraph of your essay (Part 4) be in the box labeled “Conclusion”. Once that paragraph is written—in whole or in part, do this: Click on the word “Conclusion” to form a following paragraph box marked by three dots. Keep doing that and put each source in its own “three-dot” box. In other words, after your Conclusion paragraph—the heading “Sources” gets its own paragraph box at the end, followed by separate paragraph boxes for each source entry.
b. If the approach labeled “a” above is not working out, don’t worry about the external labels of those last paragraph boxes---just be sure to have a concluding paragraph (your Part 4) followed by paragraphs for the Sources header and each source entry. In grading, I will be able to figure it out. I will be lenient on how you organize that last part, as long as you have that last paragraph and a clear Sources list.
------------------------------------
UPLOAD OPTION: You can type your paper or a good rough draft of it into MS-Word as a file. Have it organized and laid out like the FORMAT SAMPLE paper. Then Upload it to ecree. Once you upload, take a little time and edit what uploaded so that it looks like what you intended and fits the 4-part organization of the assignment.
-----------------------
7. Click “Submit” on lower right only when absolutely ready. Once you submit, it will get graded.
Have fun! (see next page for a few notes and comments on ecree)
---------.
(Image retrieved at httpswww.google.comsearchhl=en&biw=122.docxAASTHA76
(Image retrieved at https://www.google.com/search?hl=en&biw=1229&bih=568&tbm=isch&sa=1&ei=fmYIW9W3G6jH5gLn7IHYAQ&q=analysis&oq=analysis&gs_l=img.3..0i67k1l2j0l5j0i67k1l2j0.967865.968569.0.969181.7.4.0.0.0.0.457.682.1j1j4-1.3.0....0...1c.1.64.img..5.2.622...0i7i30k1.0.rL9KcsvXM1U#imgrc=LU1vXlB6e2doDM: / )
ESOL 052 (Essay #__)
Steps:
1. Discuss the readings, videos, and photographs in the Truth and Lies module on Bb.
2. Select a significant/controversial photograph to analyze. (The photograph does not have to be from Bb.)
3. Choose one of the following essay questions:
a. What truth does this photograph reveal?
b. What lie does this photograph promote?
c. Why/How did people deliberately misuse this photograph and distort its true meaning?
d. Why was this photograph misinterpreted by so many people?
e. Why do so many people have different reactions to this photograph?
f. ___________________________________________________________________________?
(Students may create their own visual analysis essay question as long as it is pre-approved by the instructor.)
4. Use the OPTIC chart to brainstorm and take notes on your photograph.
5. Use a pre-writing strategy (outline, graphic organizer, etc.) to organize your ideas.
6. Using correct MLA format, write a 3-5 page essay.
7. Type a Works Cited page. (Use citationmachine.net, easybib.com, etc. to format your info.)
8. Peer and self-edit during the writing process (Bb Wiki, in/outside class).
9. Get feedback from your peers and an instructor during the writing process.
(Note: Students who visit the Writing Center and show me proof get 2 additional days to work on the assignment.)
10. Proofread/edit/revise during the writing process.
11. Put your pre-writing, essay, and Works Cited page in 1 Word document and upload it on Bb by midnight on ______. (If a student submits an essay without pre-writing or without a Works Cited page, he/she will receive a zero. If a student submits an assignment late, he/she will receive a zero. If a student plagiarizes, he/she will receive a zero.)
Purpose: Students will be able to use their reading, writing, critical thinking, and research skills to conduct a visual analysis that explores the theme of Truth and Lies.
Tone: The tone of this assignment should be formal and academic.
Language: The diction and syntax of this assignment should be formal and academic. Students should not use second person pronouns (you/your), contractions, abbreviations, slang, or any type of casual language. Students should refer to the diction and syntax guidelines in the writing packet.
Audience: The audience of this assignment is the student’s peers and instructor.
Format: MLA style (double spaced, 1 in. margins, Times New Roman 12 font, pagination, heading, title, tab for each paragraph, in-text citations, Works Cited page, hanging indents, etc.)
Requirements:
In order for a student to earn a minimum passing grade of 70% on this assignment, h.
(Dis) Placing Culture and Cultural Space Chapter 4.docxAASTHA76
(Dis) Placing Culture and Cultural Space
Chapter 4
+
Chapter Objectives
Describe the relationships among culture, place, cultural space, and identity in the context of globalization.
Explain how people use communicative practices to construct, maintain, negotiate, and hybridize cultural spaces.
Explain how cultures are simultaneously placed and displaced in the global context leading to segregated, contested and hybrid cultural spaces.
Describe the practice of bifocal vision to highlight the linkages between “here” and “there” as well as the connections between present and past.
+
Introduction
Explore the cultural and intercultural communication dimensions of place, space and location. We will examine:
The dynamic process of placing and displacing cultural space in the context of globalization.
How people use communicative practices to construct, maintain, negotiate, and hybridize cultural spaces
How segregated, contested, and hybrid cultural spaces are both shaped by the legacy of colonialism and the context of globalization.
How Hip hop culture illustrates the cultural and intercultural dimensions of place, space, and location in the context of globalization
+
Placing Culture and Cultural Space
Culture, by definition, is rooted in place with a reciprocal relationship between people and place
Culture:
“Place tilled” in Middle English
Colere : “to inhabit, care for, till, worship” in Latin
In the context of globalization, what is the relationship between culture and place?
Culture is both placed and displaced
+
Cultural Space
The communicative practices that construct meanings in, through and about particular places
Cultural space shapes verbal and nonverbal communicative practices
i.e. Classrooms, dance club, library.
Cultural spaces are constructed through the communicative practices developed and lived by people in particular places
Communicative practices include:
The languages, accents, slang, dress, artifacts, architectural design, the behaviors and patterns of interaction, the stories, the discourses and histories
How is the cultural space of your home, neighborhood, city, and state constructed through communicative practices?
+
Place, Cultural Space and Identity
Place, Culture, Identity and Difference
What’s the relationship between place and identity?
Avowed identity:
The way we see, label and make meaning about ourselves and
Ascribed identity:
The way others view, name and describe us and our group
Examples of how avowed and ascribed identities may conflict?
How is place related to standpoint and power?
Locations of enunciation:
Sites or positions from which to speak.
A platform from which to voice a perspective and be heard and/or silenced.
+
Displacing Culture and Cultural Space
(Dis) placed culture and cultural space:
A notion that captures the complex, contradictory and contested nature of cultural space and the relationship between culture and place that has emerged in the context o.
(1) Define the time value of money. Do you believe that the ave.docxAASTHA76
(1) Define the time value of money. Do you believe that the average person considers the time value of money when they make investment decisions? Please explain.
(2) Distinguish between ordinary annuities and annuities due. Also, distinguish between the future value of an annuity and the present value of an annuity.
.
(chapter taken from Learning Power)From Social Class and t.docxAASTHA76
(chapter taken from Learning Power)
From Social Class and the Hidden Curriculum of Work
JEAN ANYON
It's no surprise that schools in wealthy communities are better than those in poor communities, or that they better prepare their students for
desirable jobs. It may be shocking, however, to learn how vast the differences in schools are - not so much in resources as in teaching methods
and philosophies of education. Jean Anyon observed five elementary schools over the course of a full school year and concluded that fifth-
graders of different economic backgrounds are already being prepared to occupy particular rungs on the social ladder. In a sense, some whole
schools are on the vocational education track, while others are geared to produce future doctors, lawyers, and business leaders. Anyon's main
audience is professional educators, so you may find her style and vocabulary challenging, but, once you've read her descriptions of specific
classroom activities, the more analytic parts of the essay should prove easier to understand. Anyon is chairperson of the Department of
Education at Rutgers University, Newark; This essay first appeared in Journal of Education in 1980.
Scholars in political economy and the sociology of knowledge have recently argued that public schools in complex industrial societies like our
own make available different types of educational experience and curriculum knowledge to students in different social classes. Bowles and
Gintis1 for example, have argued that students in different social-class backgrounds are rewarded for classroom behaviors that correspond to
personality traits allegedly rewarded in the different occupational strata--the working classes for docility and obedience, the managerial classes
for initiative and personal assertiveness. Basil Bernstein, Pierre Bourdieu, and Michael W. Apple focusing on school knowledge, have argued
that knowledge and skills leading to social power and regard (medical, legal, managerial) are made available to the advantaged social groups but
are withheld from the working classes to whom a more "practical" curriculum is offered (manual skills, clerical knowledge). While there has
been considerable argumentation of these points regarding education in England, France, and North America, there has been little or no attempt
to investigate these ideas empirically in elementary or secondary schools and classrooms in this country.3
This article offers tentative empirical support (and qualification) of the above arguments by providing illustrative examples of differences in
student work in classrooms in contrasting social class communities. The examples were gathered as part of an ethnographical4 study of
curricular, pedagogical, and pupil evaluation practices in five elementary schools. The article attempts a theoretical contribution as well and
assesses student work in the light of a theoretical approach to social-class analysis.. . It will be suggested that there is a "hidden.
(Accessible at httpswww.hatchforgood.orgexplore102nonpro.docxAASTHA76
(Accessible at https://www.hatchforgood.org/explore/102/nonprofit-photography-ethics-and-approaches)
Nonprofit Photography: Ethics
and Approaches
Best practices and tips on ethics and approaches in
humanitarian photography for social impact.
The first moon landing. The Vietnamese ‘napalm girl’, running naked and in agony. The World
Trade Centers falling.
As we know, photography carries the power to inspire, educate, horrify and compel its viewers to
take action. Images evoke strong and often public emotions, as people frequently formulate their
opinions, judgments and behaviors in response to visual stimuli. Because of this, photography
can wield substantial control over public perception and discourse.
Moreover, photography in our digital age permits us to deliver complex information about
remote conditions which can be rapidly distributed and effortlessly processed by the viewer.
Recently, we’ve witnessed the profound impact of photography coupled with social media:
together, they have fueled political movements and brought down a corrupt government.
Photography can - and has - changed the course of history.
Ethical Considerations
Those who commission and create photography of marginalized populations to further an
organizations’ mission possess a tremendous responsibility. Careful ethical consideration should
be given to all aspects of the photography supply chain: its planning, creation, and distribution.
When planning a photography campaign, it is important to examine the motives for creating
particular images and their potential impact. Not only must a faithful, comprehensive visual
depiction of the subjects be created to avoid causing misconception, but more importantly, the
subjects’ dignity must be preserved. Words and images that elicit an emotional response by their
sheer shock value (e.g. starving, skeletal children covered in flies) are harmful because they
exploit the subjects’ condition in order to generate sympathy for increasing charitable donations
or support for a given cause. In addition to violating privacy and human rights, this so-called
'poverty porn’ is harmful to those it is trying to aid because it evokes the idea that the
marginalized are helpless and incapable of helping themselves, thereby cultivating a culture of
paternalism. Poverty porn is also detrimental because it is degrading, dishonoring and robs
people of their dignity. While it is important to illustrate the challenges of a population, one must
always strive to tell stories in a way that honors the subjects’ circumstances, and (ideally)
illustrates hope for their plight.
Legal issues
Legal issues are more clear cut when images are created or used in stable countries where legal
precedent for photography use has been established. Image use and creation becomes far more
murky and problematic in countries in which law and order is vague or even nonexistent.
Even though images created for no.
(a) The current ratio of a company is 61 and its acid-test ratio .docxAASTHA76
(a) The current ratio of a company is 6:1 and its acid-test ratio is 1:1. If the inventories and prepaid items amount to $445,500, what is the amount of current liabilities?
Current Liabilities
$
89100
(b) A company had an average inventory last year of $113,000 and its inventory turnover was 6. If sales volume and unit cost remain the same this year as last and inventory turnover is 7 this year, what will average inventory have to be during the current year? (Round answer to 0 decimal places, e.g. 125.)
Average Inventory
$
96857
(c) A company has current assets of $88,800 (of which $35,960 is inventory and prepaid items) and current liabilities of $35,960. What is the current ratio? What is the acid-test ratio? If the company borrows $12,970 cash from a bank on a 120-day loan, what will its current ratio be? What will the acid-test ratio be? (Round answers to 2 decimal places, e.g. 2.50.)
Current Ratio
2.47
:1
Acid Test Ratio
:1
New Current Ratio
:1
New Acid Test Ratio
:1
(d) A company has current assets of $586,700 and current liabilities of $200,100. The board of directors declares a cash dividend of $173,700. What is the current ratio after the declaration but before payment? What is the current ratio after the payment of the dividend? (Round answers to 2 decimal places, e.g. 2.50.)
Current ratio after the declaration but before payment
:1
Current ratio after the payment of the dividend
:1
The following data is given:
December 31,
2015
2014
Cash
$66,000
$52,000
Accounts receivable (net)
90,000
60,000
Inventories
90,000
105,000
Plant assets (net)
380,500
320,000
Accounts payable
54,500
41,500
Salaries and wages payable
11,500
5,000
Bonds payable
70,500
70,000
8% Preferred stock, $40 par
100,000
100,000
Common stock, $10 par
120,000
90,000
Paid-in capital in excess of par
80,000
70,000
Retained earnings
190,000
160,500
Net credit sales
930,000
Cost of goods sold
735,000
Net income
81,000
Compute the following ratios: (Round answers to 2 decimal places e.g. 15.25.)
(a)
Acid-test ratio at 12/31/15
: 1
(b)
Accounts receivable turnover in 2015
times
(c)
Inventory turnover in 2015
times
(d)
Profit margin on sales in 2015
%
(e)
Return on common stock equity in 2015
%
(f)
Book value per share of common stock at 12/31/15
$
Exercise 24-4
As loan analyst for Utrillo Bank, you have been presented the following information.
Toulouse Co.
Lautrec Co.
Assets
Cash
$113,900
$311,200
Receivables
227,200
302,700
Inventories
571,200
510,700
Total current assets
912,300
1,124,600
Other assets
506,000
619,800
Total assets
$1,418,300
$1,744,400
Liabilities and Stockholders’ Equity
Current liabilities
$291,300
$350,400
Long-term liabilities
390,800
506,000
Capital stock and retained earnings
736,200
888,000
Total liabilities and stockholders’ equity
$1.
(1) How does quantum cryptography eliminate the problem of eaves.docxAASTHA76
(1) How does quantum cryptography eliminate the problem of eavesdropping in traditional cryptography?
(2) What are the limitations or problems associated with quantum cryptography?
(3) What features or activities will affect both the current and future developments of cryptography?
Use of proper APA formatting and citations. If supporting evidence from outside resources is used those must be properly cited.
References
.
#transformation
10
Event
Trends
for 2019
10 Event Trends for 2019
C O P Y R I G H T
All rights reserved. No part of this report may be
reproduced or transmitted in any form or by any
means whatsoever (including presentations, short
summaries, blog posts, printed magazines, use
of images in social media posts) without express
written permission from the author, except in the
case of brief quotations (50 words maximum and
for a maximum of 2 quotations) embodied in critical
articles and reviews, and with clear reference to
the original source, including a link to the original
source at https://www.eventmanagerblog.com/10-
event-trends/. Please refer all pertinent questions
to the publisher.
page 2
https://www.eventmanagerblog.com/10-event-trends/
https://www.eventmanagerblog.com/10-event-trends/
10 Event Trends for 2019
CONTENTS
INTRODUCTION page 5
TRANSFORMATION 8
10. PASSIVE ENGAGEMENT 10
9. CONTENT DESIGN 13
8. SEATING MATTERS 16
7. JOMO - THE JOY OF MISSING OUT 19
6. BETTER SAFE THAN SORRY 21
5. CAT SPONSORSHIP 23
4. SLOW TICKETING 25
3. READY TO BLOCKCHAIN 27
2. MARKETING BUDGETS SHIFTING MORE TO EVENTS 28
1. MORE THAN PLANNERS 30
ABOUT THE AUTHOR 31
CMP CREDITS 32
CREDITS AND THANKS 32
DISCLAIMER 32
page 3
INTERACTIVITY
AT THE HEART OF YOUR MEETINGS
Liven up your presentations!
EVENIUM
ConnexMe
San Francisco/Paris [email protected]
AD
https://eventmb.com/2PvIw1f
10 Event Trends for 2019
I am very glad to welcome you to the 8th edition of our annual
event trends. This is going to be a different one.
One element that made our event trends stand out from
the thousands of reports and articles on the topic is that we
don’t care about pleasing companies, pundits, suppliers, star
planners and the likes. Our only focus is you, the reader, to
help you navigate through very uncertain times.
This is why I decided to bring back this report, by far the most
popular in the industry, to its roots. 10 trends that will actually
materialize between now and November 2019, when we will
publish edition number nine.
I feel you have a lot going on, with your events I mean.
F&B, room blocks, sponsorship, marketing security, technology.
I think I failed you in previous editions. I think I gave you too
much. This report will be the most concise and strategic piece
of content you will need for next year.
If you don’t read anything else this year, it’s fine. As long as you
read the next few words.
INTRODUCTION
INTRODUCTION -
Julius Solaris
EventMB Editor
page 5
https://www.eventmanagerblog.com
10 Event Trends for 2019
How did I come up with these trends?
~ As part of this report, we reviewed 350 events. Some of the most successful
worldwide.
~ Last year we started a community with a year-long trend watch. That helped
us to constantly research new things happening in the industry.
~ We have reviewed north of 300 event technology solutions for our repor.
$10 now and $10 when complete Use resources from the required .docxAASTHA76
$10 now and $10 when complete
Use resources from the required readings or the GCU Library to create a 10‐15 slide digital presentation to be shown to your colleagues informing them of specific cultural norms and sociocultural influences affecting student learning at your school.
Choose a culture to research. State the country or countries of origin of your chosen culture and your reason for selecting it.
Include sociocultural influences on learning such as:
Religion
Dress
Cultural Norms
Food
Socialization
Gender Differences
Home Discipline
Education
Native Language
Include presenter’s notes, a title slide, in‐text citations, and a reference slide that contains three to five sources from the required readings or the GCU Library.
.
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
// Function: void parse(char *line, char **argv)
// Purpose : This function takes in a null terminated string pointed to by
// <line>. It also takes in an array of pointers to char <argv>.
// When the function returns, the string pointed to by the
// pointer <line> has ALL of its whitespace characters (space,
// tab, and newline) turned into null characters ('\0'). The
// array of pointers to chars will be modified so that the zeroth
// slot will point to the first non-null character in the string
// pointed to by <line>, the oneth slot will point to the second
// non-null character in the string pointed to by <line>, and so
// on. In other words, each subsequent pointer in argv will point
// to each subsequent "token" (characters separated by white space)
// IN the block of memory stored at the pointer <line>. Since all
// the white space is replaced by '\0', every one of these "tokens"
// pointed to by subsequent entires of argv will be a valid string
// The "last" entry in the argv array will be set to NULL. This
// will mark the end of the tokens in the string.
//
void parse(char *line, char **argv)
{
// We will assume that the input string is NULL terminated. If it
// is not, this code WILL break. The rewriting of whitespace characters
// and the updating of pointers in argv are interleaved. Basically
// we do a while loop that will go until we run out of characters in
// the string (the outer while loop that goes until '\0'). Inside
// that loop, we interleave between rewriting white space (space, tab,
// and newline) with nulls ('\0') AND just skipping over non-whitespace.
// Note that whenever we encounter a non-whitespace character, we record
// that address in the array of address at argv and increment it. When
// we run out of tokens in the string, we make the last entry in the array
// at argv NULL. This marks the end of pointers to tokens. Easy, right?
while (*line != '\0') // outer loop. keep going until the whole string is read
{ // keep moving forward the pointer into the input string until
// we encounter a non-whitespace character. While we're at it,
// turn all those whitespace characters we're seeing into null chars.
while (*line == ' ' || *line == '\t' || *line == '\n' || *line == '\r')
{ *line = '\0';
line++;
}
// If I got this far, I MUST be looking at a non-whitespace character,
// or, the beginning of a token. So, let's record the address of this
// beginning of token to the address I'm pointing at now. (Put it in *argv)
.
$ stated in thousands)Net Assets, Controlling Interest.docxAASTHA76
$ stated in thousands)
Net Assets, Controlling Interest
–
–
Net Assets, Noncontrolling Interest
AUDIT COMMITTEE
of the
Executive Board of the Boy Scouts of America
Francis R. McAllister, Chairman
David Biegler Ronald K. Migita
Dennis H. Chookaszian David Moody
Report of Independent Auditors
To the Executive Board of the National Council of the Boy Scouts of America
We have audited the accompanying consolidated financial statements of the National Council of the Boy Scouts
of America and its affiliates (the National Council), which comprise the consolidated statement of financial position
as of December 31, 2016, and the related consolidated statements of revenues, expenses, and other changes in net
assets, of functional expenses and of cash flows for the year then ended.
Management’s Responsibility for the Consolidated Financial Statements
Management is responsible for the preparation and fair presentation of the consolidated financial statements
in accordance with accounting principles generally accepted in the United States of America; this includes the
design, implementation and maintenance of internal control relevant to the preparation and fair presentation of
consolidated financial statements that are free from material misstatement, whether due to fraud or error.
Auditors’ Responsibility
Our responsibility is to express an opinion on the consolidated financial statements based on our audit. We
conducted our audit in accordance with auditing standards generally accepted in the United States of America.
Those standards require that we plan and perform the audit to obtain reasonable assurance about whether the
consolidated financial statements are free from material misstatement.
An audit involves performing procedures to obtain audit evidence about the amounts and disclosures in the
consolidated financial statements. The procedures selected depend on our judgment, including the assessment of
the risks of material misstatement of the consolidated financial statements, whether due to fraud or error. In making
those risk assessments, we consider internal control relevant to the National Council’s preparation and fair
presentation of the consolidated financial statements in order to design audit procedures that are appropriate in the
circumstances, but not for the purpose of expressing an opinion on the effectiveness of the National Council’s
internal control. Accordingly, we express no such opinion. An audit also includes evaluating the appropriateness of
accounting policies used and the reasonableness of significant accounting estimates made by management, as well as
evaluating the overall presentation of the consolidated financial sta.
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <time.h>
#include <unistd.h>
// Change the constant below to change the number of philosophers
// coming to lunch...
// This is a known GOOD solution based on the Arbitrator
// solution
#define PHILOSOPHER_COUNT 20
// Each philosopher is represented by one thread. Each thread independenly
// runs the same "think/start eating/finish eating" program.
pthread_t philosopher[PHILOSOPHER_COUNT];
// Each chopstick gets one mutex. If there are N philosophers, there are
// N chopsticks. That's the whole problem. There's not enough chopsticks
// for all of them to be eating at the same time. If they all cooperate,
// everyone can eat. If they don't... or don't know how.... well....
// philosophers are going to starve.
pthread_mutex_t chopstick[PHILOSOPHER_COUNT];
// The arbitrator solution adds a "waiter" that ensures that only pairs of
// chopsticks are grabbed. Here is the mutex for the waiter ;)
pthread_mutex_t waiter;
void *philosopher_program(int philosopher_number)
{ // In this version of the "philosopher program", the philosopher
// will think and eat forever.
while (1)
{ // Philosophers always think before they eat. They need to
// build up a bit of hunger....
//printf ("Philosopher %d is thinking\n", philosopher_number);
usleep(1);
// That was a lot of thinking.... now hungry... this
// philosopher (who knows his own number) grabs the chopsticks
// to her/his right and left. The chopstick to the left of
// philosopher N is chopstick N. The chopstick to the right
// of philosopher N is chopstick N+1
//printf ("Philosopher %d wants chopsticks\n",philosopher_number);
pthread_mutex_lock(&waiter);
pthread_mutex_lock(&chopstick[philosopher_number]);
pthread_mutex_lock(&chopstick[(philosopher_number+1)%PHILOSOPHER_COUNT]);
pthread_mutex_unlock(&waiter);
// Hurray, if I got this far I'm eating
printf ("Philosopher %d is eating\n",philosopher_number);
//usleep(1); // I spend twice as much time eating as thinking...
// typical....
// I'm done eating. Now put the chopsticks back on the table
//printf ("Philosopher %d finished eating\n",philosopher_number);
pthread_mutex_unlock(&chopstick[philosopher_number]);
pthread_mutex_unlock(&chopstick[(philosopher_number+1)%PHILOSOPHER_COUNT]);
//printf("Philosopher %d has placed chopsticks on the table\n", philosopher_number);
}
return(NULL);
}
int main()
{ int i;
srand(time(NULL));
for(i=0;i<PHILOSOPHER_COUNT;i++)
pthread_mutex_init(&chopstick[i],NULL);
pthread_mutex_init(&waiter,NULL);
for(i=0;i<PH.
#Assessment BriefDiploma of Business Eco.docxAASTHA76
#
Assessment BriefDiploma of Business Economics for Business
Credit points : 6 Prerequisites : None Co-requisites :
Subject Coordinator : Harriet Scott
Deadline : Sunday at the end of week 10 (Turnitin via CANVAS submission). Reflection due week 11 in tutorials.
ASSESSMENT TASK #3: FINAL CASE STUDY REPORT 25%
TASK DESCRIPTION
This assessment is a formal business report on a case study. Case studies will be assigned to students in the Academic and Business Communication subject. Readings on the case study are available on Canvas, in the Economics for Business subject. Students will also write a reflection on learning in tutorial classes in week 11.
LEARNING OUTCOMES
· Demonstrates understanding of microeconomic and macroeconomic concepts
· Applies economic concepts to contemporary issues and events
· Evaluates possible solutions for contemporary economic and business problems
· Communicates economic information in a business report format
INSEARCH CRICOS provider code: 00859D I UTS CRICOS provider code: 00099F INSEARCH Limited is a controlled entity of the University of Technology, Sydney (UTS), a registered non-self accrediting higher education institution and a pathway provider to UTS.
1. Refer to the case study you are working on for your presentation in Academic and Business Communication. Read the news stories for your case study, found on Canvas.
2. Individually, write a business report that includes the following information:
· Description of the main issue/problem and causes
· Description of the impact on stakeholders
· Analysis of economic concepts relevant to the case study (3-5 concepts)
· Recommendations for alternate solutions to the issue/problem
3. In your week 11 tutorial, write your responses to the reflection questions provided by your tutor, describing your learning experience in this assessment.
Other Requirements Format: Business Report
· Use the Business Report format as taught in BABC001 (refer to CANVAS Help for more information)
· Write TEEL paragraphs (refer to CANVAS Help for more information)
· All work submitted must be written in your own words, using paraphrasing techniques taught in BABC001
· Check Canvas — BECO — Assessments — Final Report page and ‘Writing a report' flyer for more information
Report Presentation: You need to include:
· Cover page as taught in BABC001
· Table of contents - list headings, subheadings and page numbers
· Reference list - all paraphrased/summarised/quoted evidence should include citations; all citations should be detailed in the Reference List
Please ensure your assignment is presented professionally. Suggested structure:
· Cover page
· Table of contents (bold, font size 18)
· Executive summary (bold, font size 18)
· 1.0 Introduction (bold, font size 16)
· 2.0 Main issue (bold, font size 16)
o 2.1 Causes (italics, font size 14)
· 3.0 Stakeholders (bold, font size 16)
o 3.1 Stakeholder 1 (italics, font size 14) o 3.2 Stakeholder 2 (italics, font size 14) o 3.3 Stakeholde.
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
// Prototype of FOUR functions, each for a STATE.
// The func in State 1 performs addition of "unsigned numbers" x0 and x1.
int s1_add_uintN(int x0, int x1, bool *c_flg);
// The func in State 2 performs addition of "signed numbers" x0 and x1.
int s2_add_intN(int x0, int x1, bool *v_flg);
// The func in State 3 performs subtraction of "unsigned numbers" x0 and x1.
int s3_sub_uintN(int x0, int x1, bool *c_flg);
// The func in State 3 performs subtraction of "signed numbers" x0 and x1.
int s4_sub_intN(int x0, int x1, bool *v_flg);
// We define the number of bits and the related limits of unsigned and
// and signed numbers.
#define N 5 // number of bits
#define MIN_U 0 // minimum value of unsigned N-bit number
#define MAX_U ((1 << N) - 1) // maximum value of unsigned N-bit number
#define MIN_I (-(1 << (N-1)) ) // minimum value of signed N-bit number
#define MAX_I ((1 << (N-1)) - 1) // maximum value of signed N-bit number
// We use the following three pointers to access data, which can be changed
// when the program pauses. We need to make sure to have the RAM set up
// for these addresses.
int *pIn = (int *)0x20010000U; // the value of In should be -1, 0, or 1.
int *pX0 = (int *)0x20010004U; // X0 and X1 should be N-bit integers.
int *pX1 = (int *)0x20010008U;
int main(void) {
enum progState{State1 = 1, State2, State3, State4};
enum progState cState = State1; // Current State
bool dataReady = false;
bool cFlg, vFlg;
int result;
while (1) {
dataReady = false;
// Check if the data are legitimate
while (!dataReady) {
printf("Halt program here to provide correct update of data\n");
printf("In should be -1, 0, and 1 and ");
printf("X0 and X1 should be N-bit SIGNED integers\n");
if (((-1 <= *pIn) && (*pIn <= 1)) &&
((MIN_I <= *pX0) && (*pX0 <= MAX_I)) &&
((MIN_I <= *pX1) && (*pX1 <= MAX_I))) {
dataReady = true;
}
}
printf("Your input: In = %d, X0 = %d, X1 = %d \n", *pIn, *pX0, *pX1);
switch (cState) {
case State1:
result = s1_add_uintN(*pX0, *pX1, &cFlg);
printf("State = %d, rslt = %d, Cflg = %d\n", cState, result, cFlg);
cState += *pIn;
if (cState < State1) cState += State4;
break;
case State2:
result = s2_add_intN(*pX0, *pX1, &vFlg);
printf("State = %d, rslt = %d, Vflg = %d\n", cState, result, vFlg);
cState += *pIn;
break;
case State3:
case State4:
default:
printf("Error with the program state\n");
}
}
}
int s1_add_uintN(int x0, int x1, bool *c_flg) {
if (x0 < 0) x0 = x0 + MAX_U + 1;
if.
#1) Identify 2020 National Health Goals related to home care d.docxAASTHA76
#1) Identify 2020 National Health Goals related to home care during pregnancy or childhood that nurses can help the nation achieve.
#2) Describe what family centered care is.
#3) Identify common areas or concerns of cultural diversity and apply these to nursing practice.
#4) Formulate 2 nursing diagnoses related to family health and what would be some interventions. How would you evaluate your interventions?
.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
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.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
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?
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
1. #include "customer.h"
#include "heap.h"
#include <iostream>
using namespace std;
int comparisonWay = 0; // 0 for arrival time, 1 for processing
time
bool Customer::operator>(const Customer& c) {
return comparisonWay ? processing_time <
c.processing_time : arrival_time < c.arrival_time; // a customer
is "greater" if his time is shorter
};
void customerQueueTest(int n_cust) {
int current_time = 0;
int totalWaitingTime = 0;
int i;
2. int WT = 0; // waiting time for each customer
Heap<Customer> queue;
Customer* custList = new Customer[n_cust];
cout << endl << endl << "Setup" << endl;
cout << "List of customers and their arrival and processing
times" << endl;
for (i = 0; i<n_cust; i++)
{
custList[i].setAT(i);
custList[i].setPT((n_cust - i) % (n_cust / 2) + 1 + (i
% 2)*(n_cust / 2));
cout << "Customer " << i << " will arrive at time " <<
custList[i].AT() << " with PT=" << custList[i].PT() << endl;
}
cout << endl;
3. for (int round = 0; round<2; round++) {
// you may need a big modification within this for-
loop
cout << endl << endl;
cout << "Test Round " << round + 1 << endl;
cout << (round == 0 ? "First come first serve" :
"Customer with the least PT served first") << endl;
comparisonWay = round;
current_time = 0;
totalWaitingTime = 0;
queue.insert(custList[0]);
cout << "Customer arrives at time " <<
custList[0].AT() << " with PT=" << custList[0].PT() << endl;
while (!queue.empty()) {
// you should change all of the code here inside
Customer c = queue.extractMax();
cout << "Customer arrives when no one is
4. waiting" << endl;
cout << "Customer is served at time " <<
current_time << " with AT=" << c.AT() << " and PT=" <<
c.PT() << " after waiting for "
<< WT << " min." << endl;
}
cout << "Total Waiting Time: " << totalWaitingTime
<< endl;
cout << "Average Waiting Time: " <<
totalWaitingTime / (float)n_cust << endl;
}
delete[] custList;
}
#pragma once
#include <math.h>
6. }
template <class T>
T Heap<T>::extractMax() {
return T();
}
template <class T>
void Heap<T>::printHeapArray() {
for (int i = 0; i < _n; i++)
cout << _heap[i] << " ";
cout << endl;
}
template <class T>
int Heap<T>::_lookFor(T x){ // not a very good
implementation, but just use this for now.
7. int i;
for(i=0;i<_n;i++)
if (_heap[i] == x)
return i;
return -1;
}
template <class T>
void Heap<T>::decreaseKey(T from, T to)
{
}
template <class T>
void Heap<T>::increaseKey(T from, T to)
{
8. }
template <class T>
void Heap<T>::deleteItem(T x)
{
}
template <class T>
void Heap<T>::printTree() {
int parity = 0;
if (_n == 0)
return;
int space = pow(2,1 + (int) log2f(_n)),i;
int nLevel = (int) log2f(_n)+1;
int index = 0,endIndex;
int tempIndex;
9. for (int l = 0; l < nLevel; l++)
{
index = 1;
parity = 0;
for (i = 0; i < l; i++)
index *= 2;
endIndex = index * 2 - 1;
index--;
tempIndex = index;
while (index < _n && index < endIndex) {
for (i = 0; i < space-1; i++)
cout << " ";
if(index==0)
cout << "|";
else if (parity)
cout << "";
else
10. cout << "/";
parity = !parity;
for (i = 0; i < space; i++)
cout << " ";
index++;
}
cout << endl;
index=tempIndex;
while (index < _n && index < endIndex) {
for (i = 0; i < (space-1-((int)
log10(_heap[index]))); i++)
cout << " ";
cout << _heap[index];
for (i = 0; i < space; i++)
cout << " ";
index++;
}
15. cout << endl;
ih.printTree();
cout << endl << endl;
for (int i = 1; i < 12; i++)
{
cout << "Extract Max: Max = ";
cout << ih.extractMax() << endl;
ih.printTree();
cout << endl << endl;
}
}
Heap and Queueing Simulation
16. Two BIG Parts
• Implementing Heap
– Basic requirement
• Perform a queueing simulation experiment
with Priority Queue
– Difficult
– Treat it as a mini project
Time to Level UP!
Something Different
• We will NOT give you the MSVC .sln or Xcode
project
– It’s time for you to create your own
– Any problem, please refer to Lab 1 slides
Something Different
• We will tell you need to do
– Namely, list of tasks
17. • However
– You have to decide the order
– There may be some additional unnamed tasks you
have to fill in
Something Different
• You have to learn how to NOT relying on the
coursemology output
– Instead relying on your own testing cases and
judgement
Given Files
• The Heap files:
– heap.h
– heap.hpp
• The driver program for your tests
– main.cpp
• Customer class, but you can ignore it for the
Heap task first
– customer.h
– customer.cpp
Part 1 Heap Implementation (Array)
18. Very First Task
• Create your own MSVC .sln or Xcode Project
Implementing Heap
• MaxHeap
– Parents > children
• You will implement the Heap with the array
representation
– It is NOT recommended to implement the heap by
pointer/tree/node representation
• The following functions are provided for you
– printHeapArray, printTree, _lookFor
Given Functions
• printHeapArray()
– print out the array that stores the heap
• printTree()
– print the heap in a graphical tree form… somehow
19. Given Functions
• The function
int Heap<T>::_lookFor(T x)
• It searches for the item x in the array and return
the index of x in the heap array
• In real practice, the index of x and x should be
stored in a symbol table/dictionary, thus, hash
table, for fast look-up of the index of x
– O(1) look-up time
• However, we just use a linear search here for our
assignment
– O(n) look-up time
Implementing Heap
• You have to implement and submit the following
functions:
– insert(x): Insert an item x into the heap
– extractMax(): extract the max. item from the heap
– decreaseKey(x,y): decrease the key of item x to y
– increaseKey (x,y): increase the key of item x to y
– deleteItem(x): remove the item x
– _bubbleUp(i): bubble up the item in index i
– _bubbleDown(i) : bubble down the item in index i
Implementing Heap
20. • You have to implement and submit the
following functions:
insert(x), extractMax(), decreaseKey(x,y), increaseKey
(x,y), deleteItem(x), _bubbleUp(i),_bubbleDown(i)
• What is the order of implementation?!
If You Implemented Correctly
If You Implemented Correctly
Second Part: Queueing Simulation
• Queueing theory is the mathematical study of
waiting lines, or queues. A queueing model is
constructed so that queue lengths and waiting
time can be predicted. Queueing theory is
generally considered a branch of operations
research because the results are often used
when making business decisions about the
21. resources needed to provide a service.
Queueing Theory
Model
• Customers
– Arrival time
– Processing time
• Time need to be served
• Queue
– Where customer wait, can be
prioritized
• Server
– Customers get served and
leave
Questions
• About waiting time
– Average WT
– Max WT
– Min WT
22. – or other WT
• For all customers
Single/Multiple Queue(s) with Multiple
Servers
What does the bank do?
Queue with “Priority”
Part 2: Queue Simulation
• First, the code customerTest() will generate 10
customers for you in customer.cpp
• And we assume that there is only ONE server
23. now
Customer Behavior
• All the customers will be stored in the array
custList[]
• To make it simple, the customer number is
equal to the time they arrived in minutes
– E.g. Customer 4 will arrive 4 min after the store
opens
• When the customer arrives, they will wait in
the waiting queue if the server is serving
another customer
Customer Behavior
• If the server is serving no one, next customer
in the queue will be served (dequeued)
• Each customer has a processing time (PT)
– The amount of time he will occupy the server
when he left the waiting queue
– The server will not server the next one in the
queue until he finish this current one
24. Waiting Time
• For each customer, his waiting time (WT) is
count as the difference between
– The time he arrives and the time he starts to be
served (dequeued)
– NOT the time he finished being served
Example (Normal Queue)
• Assume that the priority of the queue is FIFO
– Normal queue in real life
• Generate four customers (Done for you):
Time at the start of… Customer Server
0 C0 arrives Serves C0 at time 0
1 C1 arrives Serves C1 at time 1
2 C2 arrives Busy with C1
3 C3 arrives Busy with C1
4 Busy with C1
5 Serves C2 at time 5
25. 6 Serves C3 at time 6
• Customer 2 waits for 5 – 2 = 3 min in the queue
• Customer 3 waits for 6 – 3 = 3 min in the queue
Output for FIFO
• Total WT = 6 min for all customers
• Average WT = 1.5 min for each customer
For 10 Customers (Setup)
Output for FIFO (10 Customers)
However
• If we change the queue priority
– It will not be First Come First Served
• Miraculously, there is a smart scanner that can
detect the processing time for the customer in
the queue
26. • The server will serve the customer with the
LEAST processing time among the people in
the queue FIRST
Output For Least PT (10 Customers)
Conclusion?
• What is the difference in the average waiting
time for two different policy of the priority of
the queue?
– FIFO vs Least PT
• Is it just coincident? Or is it always like that?
Difference
• FIFO
• Least PT first
Given Code
27. class Customer {
private:
int arrival_time;
// time of arrival after the shop opened in min
int processing_time;
// amount of time need to be processed with the customer
serivce in
min
public:
Customer () {arrival_time = 0; processing_time = 0;};
void setAT(int t) {arrival_time = t;};
void setPT(int t) {processing_time = t;};
int AT() {return arrival_time;};
int PT() {return processing_time;};
bool operator>(const Customer& c);
// a customer is "greater" if his time is shorter
};
Comparison For Heap/PQ
• If comparisonWay = 0
– the heap be ordered by arrival times (AT)
• If comparisonWay = 0
– the heap be ordered by processing times (PT)
int comparisonWay = 0; // 0 for arrival time, 1 for processing
time
bool Customer::operator>(const Customer& c) {
28. return comparisonWay ?
processing_time < c.processing_time :
arrival_time < c.arrival_time;
// a customer is "greater" if his time is shorter
};
Actually NOT a
good practice to
use a global
variable
First Part of CustomerQueueTest()
void customerQueueTest(int n_cust) {
int current_time = 0;
int totalWaitingTime = 0;
int i;
int WT = 0; // waiting time for each customer
Heap<Customer> queue;
Customer* custList = new Customer[n_cust];
cout << endl << endl << "Setup" << endl;
cout << "List of customers and their arrival and processing
times" << endl;
for (i = 0; i<n_cust; i++)
{
custList[i].setAT(i);
custList[i].setPT((n_cust - i) % (n_cust / 2) + 1 + (i %
2)*(n_cust /
2));
cout << "Customer " << i << " will arrive at time "
<< custList[i].AT() << " with PT=" << custList[i].PT() <<
endl;
}
29. cout << endl;
Setting up n
customers for the
test
Following on
for (int round = 0; round<2; round++) {
// you may need a big modification within this for-loop
cout << endl << endl;
cout << "Test Round " << round + 1 << endl;
cout << (round == 0 ? "First come first serve" : "Customer
with the least PT served first") << endl;
comparisonWay = round;
current_time = 0;
totalWaitingTime = 0;
queue.insert(custList[0]);
cout << "Customer arrives at time " << custList[0].AT() << "
with PT=" << custList[0].PT() << endl;
while (!queue.empty()) {
// you should change all of the code here inside
Customer c = queue.extractMax();
cout << "Customer arrives when no one is waiting" << endl;
cout << "Customer is served at time " << current_time << "
with AT=" << c.AT()
<< " and PT=" << c.PT() << " after waiting for “
<< WT << " min." << endl;
}
cout << "Total Waiting Time: " << totalWaitingTime << endl;
30. cout << "Average Waiting Time: " << totalWaitingTime /
(float)n_cust << endl;
You have to
change all the
code here!
The purpose for giving you the code here is
for all those “cout” such that it will match the
coursemology test case
Difference
• FIFO
• Least PT first
Real Job
• Treat the Queueing Simulation part of your
assignment as a real job
– A mini project
10 ways school is different than the
working world
31. • If you can't do the work, you're out.
• We grade on a curve.
• …
• We hate slackers.
• You have to fight for recognition.
• We really, really, really want you to be able to write
properly.
• We really, really, really want you to be able to do math.
• If you can't make money for us, we won't hire you.
https://www.cbsnews.com/news/10-ways-school-is-different-
than-the-world-of-work/
We really, really, really want you to be able to write
CODE properly
https://www.cbsnews.com/news/10-ways-school-is-different-
than-the-world-of-work/
https://www.cbsnews.com/news/10-ways-school-is-different-
than-the-world-of-work/
https://www.cbsnews.com/news/10-ways-school-is-different-
than-the-world-of-work/
https://www.cbsnews.com/news/10-ways-school-is-different-
than-the-world-of-work/
https://www.cbsnews.com/news/10-ways-school-is-different-
than-the-world-of-work/
https://www.cbsnews.com/news/10-ways-school-is-different-
than-the-world-of-work/
https://www.cbsnews.com/news/10-ways-school-is-different-
than-the-world-of-work/
https://www.cbsnews.com/news/10-ways-school-is-different-
than-the-world-of-work/
https://www.cbsnews.com/news/10-ways-school-is-different-
than-the-world-of-work/