C++ :: Multi-level Algorithms For Date-driven Scheduling

Apr 18, 2012

What is Multi-level algorithms for date-driven scheduling?

View 8 Replies


ADVERTISEMENT

C :: Time Scheduling Algorithms Program

Jan 20, 2014

I am an IT college student and this is a self-assigned project i have done in an attempt to learn programming in C AND at the same time how time scheduling of an OS works (Both done in order to prepare for upcoming semester exams) using FCFS ,SJF, RR and PS algorithms (planning on adding SRT too sometime soon). (took me 9 hours total work time including validations). What i wanna know is from more seasoned coders if i am on the right track. *cross fingers*

Code:

#include <stdio.h>
#include <stdlib.h>
#define P_Q 1000

int main(int argc, char *argv[])
{
float min_value,
}

[code]....

View 11 Replies View Related

C/C++ :: Time Gaps In Round Robin Scheduling?

Mar 26, 2015

I've recently completed a fully functional round robin algorithm for a class, however upon running a myriad of test cases I found where mine fails. I think it best to show with an example:

Process-Burst-Arrival
P1 1 0
P2 1 1
P3 1 4
P4 3 8
P5 5 20

Currently what happens is this, it runs perfectly from process 1 through process 3. However once it reaches process 4 it does the appropriate thing and adjusts my total processing time (q variable) to the arrival time of process 4. Great! But then, it rolls over to check the queue again and it's bringing in process 5, changing q to it's arrival time. Then it proceeds to swap them in and out due to them both now being in the queue and time quantums/slices running out.

My question is this: How/where do I put a lock on the while loop that runs the simulated scheduler (round robin in this instance) to not grab the next process when there's a time gap in between each process.

This specifically is the two lines that I can't seem to get working as they should:

if(arrival[i]>q)
q=arrival[i];

FULL CODE BELOW

#include <iostream>
using namespace std;
void RR(int n, int burst[], int arrival[], int throughput)
{

[Code].....

View 14 Replies View Related

C/C++ :: Appointment Scheduling Program - Why Are Destructors Being Called

Mar 5, 2015

I am in a intro C++ class and have an assignment to create a patient appointment scheduling program. I finished my code, but when I run it the destructors in each class are being called a bunch of times and the menu shows up at the bottom of the that, so the whole output looks like a mess. Identifying why the destructors are being called like this?

#include <iostream>
#include <iomanip>
#include <string>
#include <cstdlib>
#include <time.h>
using namespace std;
void ShowMenu ();

[Code] ......

View 11 Replies View Related

C/C++ :: Given Person Birth-date Or Any Other Date Will Display Day Of Week

Oct 11, 2012

i'm making a program that, given a person's birthdate or any other date, will display the day of the week of the person was born.

There is this part where it says "use a switch statement to make this calculation, If desired month is 12, add the number of days for November, if desired month is 11 add the number of days for october....

So it's suppose to start with "case 12 :...

I can't figure out what to write for the statement....

View 6 Replies View Related

C/C++ :: Menu Driven Complex Calculations

Mar 18, 2015

//complxCalc.cpp//

#include "complx.h"
using namespace std;
ifstream infile ("in.dat");
int main() {
int i = 0;
complx tempComplx;
double d = 4.5;

[Code] ....

//in.dat//
(4,4) (6,7) (2.5, 9.3) (3,8.4) (13, 26.5) (2.2, 3.4)

My plan is to make this a menu driven program, I have already got the program to give the answers but now I want it to give the user choices as well. The first step in this project is to add a menu to the program. The first menu the user sees should ask the user if the program will be taking input from a file or from the user directly via the keyboard. Regardless of option chosen, the user should then be prompted to specify whether a multiplication,subtraction or addition operation should be performed.

If the user originally chose the file input method then the program should proceed to display to the screen the results of those operations on each pair of data elements in the file and terminate. If the user chose to input via the keyboard then the user should be prompted to input the two numbers, perform the operation on those two numbers and display the results to the screen and ask the user which mathematical operation they would like to do next and continue in this manner until the user chooses to exit the program via a menu option. Fortunately the only file that needs to be edited are in.dat and complxcalc.cpp files.

View 1 Replies View Related

C++ :: Two Way Event-driven Communication Between Objects

Oct 26, 2013

I need to implement a two-way asynchronous communication between two objects, not using any IPC.

What I have now is a producer-consumer model where producer sends a number "88" to consumer at random intervals. Now, I need consumer to send a number "99" back to producer at a random intervals, this probably should be done in a separate thread.

I am using GNU on Linux, here is the compile line.

Code:

g++ -g -std=c++11 main.cpp -o main

Code:

#include<iostream>
#include<chrono>
#include<thread>
class IObject {
public:
virtual void fromApp(int i) = 0;
virtual int toApp(int& i) = 0;// ???

[code].....

View 8 Replies View Related

C++ :: Some Algorithms For Compressing Images?

Feb 16, 2014

RLE(Run Length Encoding)
using namespace std;
class Bitwriter{
private:

[Code]....

View 1 Replies View Related

C/C++ :: Analysis And Evaluation Algorithms?

Mar 25, 2015

#include <iostream>
#include <vector>
#include <list>

[Code].....

The problem is it's not finding the shortest path.

View 1 Replies View Related

C/C++ :: Menu Driven Program - Value Returning Functions

Apr 2, 2015

I'm working on what I thought was a pretty simple program. I'm writing a menu driven program that will allow users to obtain specified measurements of several geometric figures. I was trying to test each each time I add a function.

I keep getting this error. error C3861: 'AreaOfSquare': identifier not found.

#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
#include <cmath>
using namespace std;
int menu() {
int choice;

[Code] ....

View 4 Replies View Related

C++ :: Text Editor Printing Algorithms?

Mar 26, 2013

They should apply for: backspace, return, regular char input, vertical scrolling. There is only one buffer, and it is not allowed to side scroll past max col, instead it must scroll down, appending the line cur_y + 1.

View 4 Replies View Related

C/C++ :: Sorting Algorithms And Comparison Count

Jan 30, 2014

I am trying to count the number of comparisons for each of the following sorting algorithms, Selection, Insertion, Bubble, Merge, and Quick sort. This is using an array of numbers that are sorted, reversed, and randomly arranged.

I currently increment the "number of comparison" variable before every conditional statement that compares two numbers and am getting the following results:

Number of Items in Array = 100
Selection: random = 5049; reverse = 5049; sorted = 5049;
Insertion: random = 2640; reverse = 5049; sorted = 99;
Bubble: random = 9207; reverse = 9900; sorted = 99;
Merge: random = 1221; revere = 988; sorted = 1028;
Quick: random = 690; revere = 587; sorted = 636;

View 1 Replies View Related

Visual C++ :: Analysis And Evaluation Algorithms

Mar 25, 2015

Undirected graph G = {V, E} is given by the list next to the DS. Let u, v of V. Construction of two paths algorithm A1 (u, v) and A2 (u, v) such that no edge in common and have the shortest total length.

View 1 Replies View Related

C++ :: Two Date Structures Sharing Same Date

Mar 28, 2014

I have two date/time structures which I'm populating, but when I populate the second one it sets the same values in the first. This is what I've got so far

tm *FirstDate = gmtime(&now);
tm *SecondDate = gmtime(&now);

cout <<"Enter your first date in the format dd/mm/yyyy" << endl <<">";
getline (cin,tempstring);

[Code] .....

View 2 Replies View Related

C :: Menu Driven Array Of Function Pointers Calculator

May 12, 2013

The premise of this assignment is to create a menu driven, array of functions calculator. This is the code I have thus far (I haven't finished all of my comments yet, I've been to focused on clearing errors).

Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

/*prototypes*/
void sum (int a, int b);
void dif (int a, int b);
void pro (int a, int b);
void quo (int a, int b);
void printMenu();

[Code] .....

I am using Visual Studio as a compiler, and I have the following errors:

error C2144: syntax error : 'int' should be preceded by ')'
error C2660: 'sum' : function does not take 0 arguments
error C2059: syntax error : ')'
error C2144: syntax error : 'int' should be preceded by ')'

[Code] .....

I can only assume that I am making simple mistakes.

View 4 Replies View Related

C++ :: Test Navigating With Arrows In Menu Driven Program

Aug 6, 2014

This is a program used to test navigating with arrows in a menu driven program

Whenever I run it it works but when I select any option it just producing a 'sound' but it doesn't print (cout) anything on the screen....

This program is just to test the arrow navigation and doesn't really modify,delete or add a new record but only prints stuff on screen.

#include<fstream.h> //for reading and writing files
#include<conio.h> //for clrscr()
#include<string.h> //for string characters
#include<stdio.h> //for gets and puts function

[Code] ....

View 7 Replies View Related

C++ :: Output Compiled Script Into Binary File - Scripting Tool Algorithms

Dec 25, 2014

I am working on a script compiler that must output compiled script into binary file. Compiling etc is not a problem. The problem is detecting some specific cases. Nothing seems to work. If it works, then it breaks as soon as i modify the script.

Here is example "script1":

Code:
1VAR1 c1 = 44
2VAR2 c2 = 66
3beginscript
4if(c1=44)
5do_nothing

[Code] ....

Second example "script2", when there can be also some command between ENDIF and ENDIF. In this case: do_nothing command.

Code:
1VAR1 c1 = 44
2VAR2 c2 = 66
3beginscript
4if(c1=44)
5do_nothing

[Code] ....

The INDEXES before each line are not in actual script. They are just to point YOU to specific lines. Although the INDEXes are in compiled script!! This is very important. As you see there can be simple IF_ENDIF and nested (more complex) IF_ENDIF.

i.e IF_ENDIF inside another IF_ENDIF.

There are also IF_ELSE_ENDIF and some other ones, but im trying to make simple IF_ENDIF work first.

ENDIF is "SPECIAL" command, the IF, DO_NOTHING are "usual" commands.

"Usual" commands must always jump over(!) the ENDIF. ALWAYS!!

They must "ignore" them!

One strong RULE is like this for usual commands: always jump over any ENDIF, not matter what. If there is one, two or more ENDIF's in a row, then just jump over them to the closest NEXT usual block command. If there is some "usual" block command between multiple ENDIFs, then jump to this command and this command must therefore check whats next command right after it. And do the same: check if next command is ENDIF, if yes, jump over it, until "usual" block command is found.

This is the place im stuck. When i some time ago thinked about some ideas, i saw some patterns. One of them was that: Seems like if its nested IF_ENDIF, then every usual block command jumps out of it, i.e. right after the final ENDIF of this current nested IF_ENDIF.

But as soon as i added do_nothing between the two ENDIFs the so called "pattern" broke. In script2 above you see index 11 is do_nothing. Ok its in nested IF_ENDIF it should jump out to command index 17. But no, because there is do_nothing between index 13 and 16. If we jump out at index 11, the command 14 would never execute. This is a BIG NO. One idea i was thinking and trying was to use STL::FIND, STL::FIND_IF to find next "usual" command after specific index. But my code seems to crash sometimes and not work always.

Code:
bool NextNonENDIF(int i) {
return (i!=98);
}
int findNextBlockCmd(vector<int>&vec, int curidx)

[Code] ....

Here i pass him the vector that contains all the command TYPES in current script. Each command has its own TYPE or better called unique ID in which way compiler knows what is what. So in this case im trying to find a command thats NOT "ENDIF", in other words im trying to find next usual command after specific type of command. Lets just say the TYPE or unique ID of do_nothing is 555, im trying to find it.

How i should continue with this? What to use maybe stl::stack, some custom command indexing, some sort of labelling for usual commands in nested IF_ENDIFs or what?

In general, look script2, and i ask: There is index 11, this guy should look if there is any usual block command left for him before the final ENDIF at index 16. If there is, jump to it. If there is none, jump out of this nested IF_ENDIF to index 17.

Question: how to do it? What algorithms to use? I can use STL, BOOST, whatever. And i can use C++11.

View 1 Replies View Related

C :: Low Level Library To Interface With The Mouse?

Mar 6, 2015

I want to track the mouse movement. I know that GTk+ provides some powerful libraries for creating GUI, that will, among other things, enable me to write handlers for mouse movement events, but I'm looking for a simpler, more compact capabilities for now.

Is there a low level C library that will enable me to interface with the mouse?

View 5 Replies View Related

C# :: Variable Protection Level In Class

Oct 20, 2012

With what protection level c# treats variable "a" in "myclas", because I get error code when I want to change it?

Code:
using system;
class myclass {
int a;
}
class mainclass {

[Code] .....

View 4 Replies View Related

C++ :: Setting Time Limit For A Level In 2D Game

Jan 2, 2014

So I am have made this 2D ball game. But I want to set a time limit for each level. I want player to play that level for maximum 3 minutes. After 3 minutes the game level should end. I have used allegro 5.0.10 with c++ . How to achieve it?

View 2 Replies View Related

Visual C++ :: Low-Level Keyboard Input Detection?

Mar 13, 2014

I am writing an software that should be able to detect all keyboard inputs by the user. i.e., both hardware and software/on-screen keyboard.

This software is going to be written in a platform independent way and supposed to run on Windows, Linux, Android & iOS.

The idea is to capture the keyboard inputs from a low level, there by making sure that it doesn't miss any inputs even if it's a on-screen keyboard like in a mobile device.

I am looking at possible open source libraries that can be used.

View 1 Replies View Related

C :: How To Create Double Link List For 2 Level Hierarchy

Jun 11, 2014

I have to create a 2D link list with 2 level hierarchy

some thing like that

Code:
head nodes level 1: 0 1 2
/| / /|
Sub node level 2: 0 1 2 0 1 0 1 2
Real Data under |
each sub node: |

int **join=Null;
int unique = 0;
int col;
int ptr;
int *tmp_perm=Null;
int col_elem;

I know how to deal with 1 level link list structure. But i don't know how to access, delete, nodes and sub nodes from this 2 level hierarchy. C

View 4 Replies View Related

C :: How To Access Sata Hard Drive At Sector Level

Mar 7, 2013

I want to access sata hard drive(eg. D drive) at sector level using C programming.I want to read the values stored in the memory locations.

View 3 Replies View Related

C++ :: Create Symbol Table For High Level Language?

Jan 21, 2013

How to create a symbol table for an assembly language and high level language in c++?

View 1 Replies View Related

C++ :: Add Score Between 0 And 1000 Inputted By User To Total And Increase Level

May 9, 2013

The program is supposed to have a method called Hitscore that adds a score between 0 and 1000 inputted by the user to the total score and increases level by one and print the score to the screen and which level they last completed after each entry . Have the user continue inputting scores to the program until the gamer has finished all 10 levels. After 10 levels, use a method you create called PassScore to have the program compare the score to avgscore (5000). If the score is less than avgscore, have the code respond "You are not angry at all. " if it is above avgscore, then have it respond "You seem quite angry, calm down. " and if it is exactly 5000, have it respond "Average, just average. "

//Angrybird.h
#ifndef ANGRYBIRD_H
#define ANGRYBIRD_H
using namespace std;
class Angrybird {
public:

float newscore;
float level;

[Code] .....

View 1 Replies View Related

C Sharp :: Error Concerning Sorted List Not Being Accessible Due To Its Protection Level

Oct 7, 2012

For school we have to create a blackjack game using windows form. I had to store the images of each card into a sorted list so i created a class called cardList and created a constructor which contained the the sorted list called cards. So it looks kinda like this:

public class cardList : Form1
{
SortedList cards = new SortedList();  
public cardList()

[Code]....

There's probably a few other errors, I'm still trying to figure this whole c# thing out. why the error tells me (on the line that contains c.cards.GetByIndex(cardNumber);) that cards is inaccessible due the its protection level.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved