Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

This Is For String Input Convert It Into For Character Input /******************************************************************************* * File

this is for string input convert it into for character input /******************************************************************************* * File Name : circularQueue.cpp * Description : Circular Queue assignment skeleton starting point * * Author : * Date: June 27, 2017 * Updated: July 22, 2019 ****************************************************************************** */ #include “pch.h” #include #include #include DWORD WINAPI myReadThreadFunction(LPVOID lpParam); // function used by read from queue thread unsigned int putToCircularQueue(char *ptrInputBuffer, unsigned int bufferLength); // circular queue function to add data to queue unsigned int getFromCircularQueue(char *ptrOutputBuffer, unsigned int bufferLength); // circular queue function to remove data from queue #define BUFFER_SIZE 200 // local buffer used for sending or receiving data to/from queue in main and worker thread #define INPUT_TIMEOUT_MS 5000 // dequeue every 5 seconds #define CIRCULAR_QUEUE_SIZE 200 // size of the circular queue                                                                                    // data structure used to keep track of circular queue (DO NOT CHANGE THIS STRUCTURE) struct myQueueStruct {    char *ptrBuffer = NULL; // pointer to start of the circular queue buffer    volatile unsigned int queueCount = 0; // number of characters currently in cirucular queue    volatile char *ptrCircularHead = NULL; // location where data is added to queue    volatile char *ptrCircularTail = NULL; // loation where data is removed from queue }; struct myQueueStruct myQueue; // create an instance of the circular queue data structure                                            // DO NOT CHANGE THE CODE IN MAIN int main() {    HANDLE hThread; // handle to thread    char inputBuffer[BUFFER_SIZE];    myQueue.ptrBuffer = (char *)calloc(CIRCULAR_QUEUE_SIZE, sizeof(char));    if (myQueue.ptrBuffer == NULL)    {        printf(“Error unable to allocate memory for buffern”);        exit(-1);    }    myQueue.ptrCircularHead = myQueue.ptrCircularTail = myQueue.ptrBuffer;    // create a thread that will consume the data we type in to demonstrate dequeing the data    hThread = CreateThread(        NULL, // default security attributes        0, // use default stack size        myReadThreadFunction, // thread function name        NULL, // argument to thread function (not being used)        0, // use default creation flags        NULL); // returns the thread identifier (not being used)                                // get a string from the console and queue it to circular queue    while (1)    {        scanf_s(“%s”, inputBuffer, BUFFER_SIZE); // get data from console                                                    // put the data into the circular queue but check if an error (marked by queue function returning 0) occurred        if (putToCircularQueue(inputBuffer, (unsigned int)strlen(inputBuffer)) == 0)            printf(“Error queuing datan”);    }    return 0; } // FUNCTION : putToCircularQueue // DESCRIPTION : // Put the supplied data into a circular queue // PARAMETERS : // ptrInputBuffer – a pointer to the buffer to be put into the queue // bufferLength – how many characters are in the buffer being put into the queue // // RETURNS : // Number of characters successfully queued (0 on failure) unsigned int putToCircularQueue(char *ptrInputBuffer, unsigned int bufferLength) {    unsigned int numberOfCharsQueued = 0; // number of characters placed in circular queue    unsigned int count = 0;    if (bufferLength > numberOfCharsQueued) //to check if the number of items in the queue is less than the buffer length    {        for (count = 0; count < bufferLength; count )       //for loop to keep the count within the size of the buffer        {            *myQueue.ptrCircularHead = *ptrInputBuffer; //head of the queue is assgined to the input buffer            myQueue.ptrCircularHead ;            numberOfCharsQueued ;            ptrInputBuffer ;            if (CIRCULAR_QUEUE_SIZE myQueue.ptrBuffer < myQueue.ptrCircularHead) //to check if the head has excedded the size of the queue            {                myQueue.ptrCircularHead = myQueue.ptrBuffer; //if the above condition is true, it goes to the buffer pointer            }            myQueue.queueCount ;        }    }    else    {        printf("Queue is full");    }    return numberOfCharsQueued; } // FUNCTION : getFromCircularQueue // DESCRIPTION : // Read as much data as there is room for from the circular queue // PARAMETERS : // ptrOutputBuffer – a pointer to the buffer to place the data read from queue // bufferLength – maxiumum number of characters that can be read (IE the size of the output buffer) // // RETURNS : // Number of characters successfully queued (0 if none are read) unsigned int getFromCircularQueue(char *ptrOutputBuffer, unsigned int bufferLength) {    unsigned int readCount = 0;    for (readCount = 0; readCount < bufferLength; readCount )           //for loop to keep count within the size of the buffer    {        *ptrOutputBuffer = *myQueue.ptrCircularTail; //circular buffer tail is assigned to output buffer pointer        myQueue.ptrCircularTail ;        ptrOutputBuffer ;        if (myQueue.ptrBuffer CIRCULAR_QUEUE_SIZE < myQueue.ptrCircularTail) //to check if the tail has excedded the size of the queue        {            myQueue.ptrCircularTail = myQueue.ptrBuffer; // if the above condition is true, it goes to the buffer pointer        }    }    return readCount; } // FUNCTION : myReadThreadFunction // DESCRIPTION : // A seperate thread from the main program that will independently check for data in queue and print it out // DO NOT CHANGE THIS CODE! // PARAMETERS : // lpParam – arguement passed into thread (not used in this example) // // RETURNS : // Will never return so no effective return value DWORD WINAPI myReadThreadFunction(LPVOID lpParam) {    char readBuffer[BUFFER_SIZE]; // local buffer to put the data into when reading from queue and print    unsigned int readCount = 0; // the number of characters read from queue    while (1)    {        Sleep(INPUT_TIMEOUT_MS); // wait for some data to be received                                    // check if data is available and if so print it out        readCount = getFromCircularQueue(readBuffer, BUFFER_SIZE);        if (readCount != 0) // check for reads that did not get any data            printf("UNQUEUE: %sn", readBuffer);    }    return 0; // will never reach here }

Consider The Following Class Definitions: Class Employee{ Private Int EmpNum; Protected Double EmpSal;

Consider the following class definitions: class Employee{   private int empNum;   protected double empSal;    public int EmpNum{     get {return empNum;}     set {empNum = value;} } public double EmpSal {     get {return empSal;}     set {double MININUM = 15000;          if (value < MININUM)            empSal = MININUM;          else            empSal = value;} } public string GetGeeting(){      string greeting = "Hello, I am employee #" EmpNum;      return greeting; } } class CommissionEmployee : Employee{   private double commissionRate;   public double CommissionRate{     get { return commissionRate;}     set { commissionRate = value;           empSal = 0;} } } Suppose the following statement is used in a program (client code): CommissionEmployee salesperson = new CommissionEmployee(); Determine if following statements are valid or invalid. Clearly mark YES or NO. (10 @ 2 each) salesperson = 0.07; salesperson.EmpNum = 345; salesperson.EmpNum; EmpSal = 20000; salesperson.CommissionRate.ToString("P");

Assume That You Have Been Appointed As An Oracle Administrator In Gaborone Private Hospital,

Assume that you have been appointed as an Oracle administrator in Gaborone Private Hospital, Botswana to design and develop a Patient Management System. The patient management system should be able to manipulate the below information, but not limited to; Patients’ personal information Doctors’ details Appointment details Patients’ medical details Design a database with required tables with your own creativity which completely gives information about the above scenario. Create a report (Word Document) as answers for the following Questions. Create a database and ensure that the database name contains the last four digits of your student ID. Screenshots are to be attached.    (10 Marks) Required Tables with fields, datatypes and constraints. Screenshots are to be attached. (30 Marks) 3.Storyboard for the Patient Management System (10 Marks

Write A C Program That Takes Two Numbers And Uses The Pow() Fuction To

Write a C program that takes two numbers and uses the pow() fuction to illustrate exponentials in Visual Studio. i.e cout: 2^4 =16

What Are The Three Generations Through Which Wireless Security Has Progressed? How Are They

What are the three generations through which wireless security has progressed? How are they different?

1) Draw A Cuboid For The 3 Attributes Of Product, Sales Rep And Customer.

1) Draw a Cuboid for the 3 attributes of Product, Sales Rep and Customer. Upload your document. PLEASE EXPLAIN IN DETAIL

1) What Are The Predictive Tasks In Data Mining? PLEASE EXPLAIN IN DETAIL

1) What are the Predictive tasks in Data Mining? PLEASE EXPLAIN IN DETAIL

1) What Are The Descriptive Tasks In Data Mining? PLEASE EXPLAIN IN DETAIL

1) What are the Descriptive tasks in Data Mining? PLEASE EXPLAIN IN DETAIL

This Is EAS 230 Which Means First Computer Programming Class. Please Don’t Use Any

This is EAS 230 which means first computer programming class. please don’t use any higher lev coding/ languages. Thank You last image is just an example for the format. Last image is an example for plotting nodes/ members. 3rd and 4th image are thrre geomtopo files. Its in order: Data1= geomtopo1 Data2= geomtopo2 Data3=geomtopo3 I already provided the info for geomtopo files.

Describe The Concepts Of Messaging, Events, And Listeners As They Relate To Developing GUI

Describe the concepts of messaging, events, and listeners as they relate to developing GUI applications within java. As part of your discussion include a description of the role of event handlers.

Please Disregard Where It Says “PODOLOL” In The Question, I Do Not Understand Why

Please Disregard where it says “PODOLOL” in the question, I do not understand why it is there and has nothing to do with the question also disregard where is says something about being mentioned in class that is not needed for part of the solution.

Create A Topical (Example: Neighborhood Garage Sale) HTML Page That Contains The Following: Should

Create a topical (Example: Neighborhood Garage Sale) HTML page that contains the following: Should be created with notepad , but i do not know if it is the same look at notepad. Please help A specified HTML page title. At least two HTML headings. At least three different size HTML fonts. At least two different colored HTML fonts. Apply HTML italics, bold, and underline to text. An HTML table. An HTML list. An HTML specified background color. An HTML anchor, which returns the user to the top of the page. One HTML hyperlink to another website or email address.

Can You Detailize By Underline Every Differnt Classes And Pls Flowcharts. Complete The Code

Can you detailize by underline every differnt classes and pls flowcharts. Complete the code below, some of which is valid code and some pseudo code that needs to be fleshed out and clearly commented. Submit your pseudo code and flowcharts, finished code, and a test run of the code in two documents. Cite all sources which have informed your coding. Share the process of completing this assignment. public class TestAutomobiles { public static void main(String[] args) { Create a new Automobile(1451, “Chevrolet”, “Camaro”, “red”, 2010, 24.5); Create another new Automobile(145188, “Ford”, “Focus”, “white”, 2019, 75); Display auto1 information Display auto2 information auto1.setId(-3); display(auto1, “bad ID”); auto1.setId(2222); display(auto1, “good ID”); auto1.setMake(“Toyota”); auto1.setModel(“Corolla”); display(auto1, “chnage make and model”); auto2.setId(8686); auto2.setColor(“blue”); auto2.setYear(2016); display(auto2, “change ID, color, and year”); auto2.setMpg(4); display(auto2, “bad mpg”); auto2.setMpg(30); display(auto2, “good mpg”); } public static void display(Automobile auto, String msg) { Screen print a message, an ID, a make, a model , a color, a year, milage per gallon } } public class Automobile { private int id; private String make; private String model; private String color; private int year; private double mpg; // Constructor public Automobile(int id, String make, String model, String color, int year, double mpg) { setId(id); setMake(make); setModel(model); setColor(color); setYear(year); setMpg(mpg); } // setters Set setId(int id) Set setMake(String make) Set setModel(String model) Set setColor(String color) Set year setYear(int yr) Set setMpg(double mpg) { //Getters Getter for getId() Getter for getMake() Getter for getModel() Getter for getColor() Getter for getYear() Getter for getMpg() } Submission Details: Create the code and sample run files.

1) What Are 3 Simple But Important Techniques In Cluster Analysis? PLEASE EXPLAIN IN

1) What are 3 simple but important techniques in Cluster analysis? PLEASE EXPLAIN IN DETAIL

Describe Each Phase Of The Systems Development Life Cycle And What Is The Primary

Describe each phase of the systems development life cycle and what is the primary function of each phase. Share your knowledge and experience

3. Paget Integrated Solutions (40 Pts) Constance Paget Is The Owner Of Paget Integrated

3.   Paget Integrated Solutions (40 pts) Constance Paget is the owner of Paget Integrated Sol utions, a Web technology consulting firm based in Seattle, Washington. Paget is planning a seminar on Web applications with a popular guest speaker to take place in Houston, Texas, next spring. She wants your help in generating a budget for the seminar that will incorporate the fixed, variable, and mixed costs to determine under what conditions the seminar will be profitable for her company. a.   Use formulas to find total revenue, total fixed cost, variable cost, mixed costs and balance. (Hint: Vlookup function is required to find the mixed costs) b.   Use goal seek to determine what number of attendees will result in a balance of $0. c.   Constance know that the registration fee for the seminar increases, the number of attendees willing to pay decreases. Change the number of attendees from a constant value to the following formula: Use Solver to determine the registration fee that will maximize the balance value with the constraint that the registration fee should be an integer.

3. Analysing Malicious Windows Programs (a) List Three Windows File System Functions That Are

3. Analysing Malicious Windows Programs (a) List three Windows file system functions that are commonly used by malware. Explain what each does. (b) Figure 3 shows the code listing for some malware. Explain in detail what it is doing. Why is it doing this? (c) Figure 4 shows the first few lines of a piece of malware along with the function definition for CreateThread. Complete the rest of the code so that the malware can send all information to a socket in order to communicate seamlessly with a running application.

Scheme Language Not Really Understanding The Problem And How To Incorporate Map-stream :((

Scheme Language Not really understanding the problem and how to incorporate map-stream :((

Modify Your Program From Learning Journal Unit 7 To Read Dictionary Items From A

Modify your program from Learning Journal Unit 7 to read dictionary items from a file and write the inverted dictionary to a file. You will need to decide on the following: How to format each dictionary item as a text string in the input file. How to covert each input string into a dictionary item. How to format each item of your inverted dictionary as a text string in the output file. Create an input file with your original three-or-more items and add at least three new items, for a total of at least six items. Include the following in your Learning Journal submission: The input file for your original dictionary (with at least six items). The Python program to read from a file, invert the dictionary, and write to a different file. The output file for your inverted dictionary. A description of how you chose to encode the original dictionary and the inverted dictionary in text files. Here is my code: def invert_dict(d): inverse = dict() for key in d: val = d[key] for item in val: inverse[item]=key; return inverse #hist is creating a dictionary to identify the list of animal families and its type. hist = dict({‘Herbi’: {‘cow’, ‘horse’, ‘rabbit’}, ‘Carnivore’: {‘lion’, ‘tiger’, ‘chetha’}, ‘Reptiles’: {‘russel viper’, ‘python’, ‘black mamba’} })    print(“Before the inversion”) for key in hist: print(key,hist[key], sep=” : “)       inverse = invert_dict(hist) print(“nAfter the inversion”) for key in inverse: print(key,inverse[key], sep=” : “) == Output: Before the inversion Herbi : {‘rabbit’, ‘horse’, ‘cow’} Carnivore : {‘chetha’, ‘tiger’, ‘lion’} Reptiles : {‘python’, ‘black mamba’, ‘russel viper’} After the inversion python : Reptiles black mamba : Reptiles russel viper : Reptiles We identify the list of animals according to their kind. Also inverted dictionary is helpful to identify whether the particular is herbivore, carnivore or reptile family. But here this seems the inverted dictionary is not very helpful because it consumes more memory. The required answer is bold.. What I need for the answer is above unbolded texts.

Must Be Written In 32-bit Register Assembly Masm X86 Volume And Area Of A

must be written in 32-bit register assembly masm x86 Volume and Area of a Cylinder Ask the user to supply the radius and height of a regular cylinder and then: i) report the Surface Area of a single end; ii) the area of the side, iii) the total surface area (both ends and the side) of the cylinder and the volume of the cylinder. Your program should loop until the value 0 is entered for the radius – and then it should promptly exit.

What Are The Answers To These Two Questions? Urgent!Thanks Here Is The Information Which

What are the answers to these two questions? urgent!Thanks Here is the information which is in16 but not 15

The post This Is For String Input Convert It Into For Character Input /******************************************************************************* * File appeared first on Smashing Essays.

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"