Tags » C Program

Dirty8085: An Intel 8085 Microprocessor simulator

This is another quick post about an unfinished (but working) software which I wrote around 8 years ago. It is an Intel 8085 microprocessor simulator, with a text based interface. 3,579 more words

Programming

CPULeash: A tool for capping per-process and process group CPU utilisation from userspace

It’s now mid October, there are 0 posts in 2017. Therefore I think it’s time to loosen up posting constraints and try make a bit more casual posts. 9,971 more words

Programming

(18)(DSA)c++ program to store set of negative and positive number using linked list write functions.


//posneg_ll.cpp

/*

Date:- 12-10-2017

Problem Statement:-
Write a c++ program to store set of negative and positive number using linked list write functions
a) Insert numbers
b) Delete nodes with negative numbers. 1,032 more words
2nd Year COMP/IT (SPPU)

C++ Program to generate a computerized telephone directory for a cellular service.


/*
* phonebook.cpp
*
* Created on: Sep 8, 2017
* Author: Harshal Borhade

*
*/
/*
Problem Statement: Design and implement a program to generate a computerized telephone
directory for a cellular service consisting of name and cell phone number. 1,240 more words
2nd Year COMP/IT (SPPU)

C++ Program for implementing a city database using the suitable data structure.


/*
* cities_db.cpp
*
* Created on: Sep 15, 2017
* Author: Harshal Borhade
* Roll No: SCSB 407
* Assignment No. 5
*/
/*
Problem Statement:Design and develop a program for implementing a city database
using the suitable data tructure to store the database records. 1,523 more words
2nd Year COMP/IT (SPPU)

(21)(OOPS)C++ Program to implement STL for implementation of stack and queue using SSL


//Program to implement stack and queue using SSL
/*
Author:- Pratik Kamble
College:- VIIT Pune

*/
#include<iostream>
#include<queue>
#include<stack>
#include<string>
#include<cstdlib>

using namespace std;

int main()
{
stack<int> st;
queue<int> qu;
int choice, item,ch;
char yn;
Start:

cout<<"\n\t\tImplementation of Stack and Queue using STL.\n";
cout<<"\n 1) Stack\n 2)Queue\n";
cout<<"Enter your choice:";
cin>>ch;

if(ch==1)
{
while (1)
{
cout<<"Stack Implementation in STL"<<endl;
cout<<"1.Insert Element into the Stack"<<endl;
cout<<"2.Delete Element from the Stack"<<endl;
cout<<"3.Size of the Stack"<<endl;
cout<<"4.Top Element of the Stack"<<endl;
cout<<"5.Exit"<<endl;
cout<<"Enter your Choice: ";
cin>>choice;
switch(choice)
{
case 1:
cout<<"Enter value to be inserted: ";
cin>>item;
st.push(item);
break;
case 2:
item = st.top();
st.pop();
cout<<"Element "<<item<<" Deleted"<<endl;
break;
case 3:
cout<<"Size of the Queue: ";
cout<<st.size()<<endl;
break;
case 4:
cout<<"Top Element of the Stack: ";
cout<<st.top()<<endl;
break;
case 5:
exit(1);
break;
default:
cout<<"Wrong Choice"<<endl;
}
}
}

else if(ch==2)
{
while(1)
{
cout<<"\n Queue Implementation in STL"<<endl;
cout<<"\n1.Insert Element into the queue";

cout<<"1.Insert Element into the Queue"<<endl;
cout<<"2.Delete Element from the Queue"<<endl;
cout<<"3.Size of the Queue"<<endl;
cout<<"4.Front Element of the Queue"<<endl;
cout<<"5.Last Element of the Queue"<<endl;
cout<<"6.Exit"<<endl;
cout<<"Enter your Choice: ";
cin>>choice;
switch(choice)
{
case 1:
cout<<"Enter value to be inserted: ";
cin>>item;
qu.push(item);
break;
case 2:
item = qu.front();
qu.pop();
cout<<"Element "<<item<<" Deleted"<<endl;
break;
case 3:
cout<<"Size of the Queue: ";
cout<<qu.size()<<endl;
break;
case 4:
cout<<"Front Element of the Queue: ";
cout<<qu.front()<<endl;
break;
case 5:
cout<<"Back Element of the Queue: ";
cout<<qu.back()<<endl;
break;
case 6:
exit(1);
break;
default:
cout<<"Wrong Choice"<<endl;
}

}
}

else
{
cout<<"\n Ooopss...Wrong choice.\1";
goto Start;
}

cout<<"\nDo you want to continue? 210 more words
2nd Year COMP/IT (SPPU)

(23)(OOPS)C++ Program to Implement Dequeue(Double ended Queue) in STL

// C++ Program to Implement Dequeue in STL
/*
Author:- Pratik Kamble
* College:- VIIT Pune
*
*/

#include <iostream>
#include <deque>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
deque<int> dq;
deque<int>::iterator it;
int choice, item;
cout<<"Dequeue Implementation in STL"<<endl;
while (1)
{

cout<<"\n1.Insert Element at the End"<<endl;
cout<<"2.Insert Element at the Front"<<endl;
cout<<"3.Delete Element at the End"<<endl;
cout<<"4.Delete Element at the Front"<<endl;
cout<<"5.Front Element at Dequeue"<<endl;
cout<<"6.Last Element at Dequeue"<<endl;
cout<<"7.Size of the Dequeue"<<endl;
cout<<"8.Display Dequeue"<<endl;
cout<<"9.Exit"<<endl;
cout<<"Enter your Choice: ";
cin>>choice;
switch(choice)
{
case 1:
cout<<"Enter value to be inserted at the end: ";
cin>>item;
dq.push_back(item);
break;
case 2:
cout<<"Enter value to be inserted at the front: ";
cin>>item;
dq.push_front(item);
break;
case 3:
item = dq.back();
dq.pop_back();
cout<<"Element "<<item<<" deleted"<<endl;
break;
case 4:
item = dq.front();
dq.pop_front();
cout<<"Element "<<item<<" deleted"<<endl;
break;
case 5:
cout<<"Front Element of the Dequeue: ";
cout<<dq.front()<<endl;
break;
case 6:
cout<<"Back Element of the Dequeue: ";
cout<<dq.back()<<endl;
break;
case 7:
cout<<"Size of the Dequeue: ";
cout<<dq.size()<<endl;
break;
case 8:
cout<<"Elements of Dequeue: ";
for (it = dq.begin(); it != dq.end(); it++)
cout<<*it<<" ";
cout<<endl;
break;
case 9:
exit(1);
break;
default:
cout<<"Wrong Choice"<<endl;
}
}
return 0;
}

/*
Output:
*
* Dequeue Implementation in STL

1.Insert Element at the End
2.Insert Element at the Front
3.Delete Element at the End
4.Delete Element at the Front
5.Front Element at Dequeue
6.Last Element at Dequeue
7.Size of the Dequeue
8.Display Dequeue
9.Exit
Enter your Choice: 1
Enter value to be inserted at the end: 23

1.Insert Element at the End
2.Insert Element at the Front
3.Delete Element at the End
4.Delete Element at the Front
5.Front Element at Dequeue
6.Last Element at Dequeue
7.Size of the Dequeue
8.Display Dequeue
9.Exit
Enter your Choice: 2
Enter value to be inserted at the front: 34

1.Insert Element at the End
2.Insert Element at the Front
3.Delete Element at the End
4.Delete Element at the Front
5.Front Element at Dequeue
6.Last Element at Dequeue
7.Size of the Dequeue
8.Display Dequeue
9.Exit
Enter your Choice: 8
Elements of Dequeue: 34 23

1.Insert Element at the End
2.Insert Element at the Front
3.Delete Element at the End
4.Delete Element at the Front
5.Front Element at Dequeue
6.Last Element at Dequeue
7.Size of the Dequeue
8.Display Dequeue
9.Exit
Enter your Choice: 5
Front Element of the Dequeue: 34

1.Insert Element at the End
2.Insert Element at the Front
3.Delete Element at the End
4.Delete Element at the Front
5.Front Element at Dequeue
6.Last Element at Dequeue
7.Size of the Dequeue
8.Display Dequeue
9.Exit
Enter your Choice: 6
Back Element of the Dequeue: 23

1.Insert Element at the End
2.Insert Element at the Front
3.Delete Element at the End
4.Delete Element at the Front
5.Front Element at Dequeue
6.Last Element at Dequeue
7.Size of the Dequeue
8.Display Dequeue
9.Exit
Enter your Choice: 3
Element 23 deleted

1.Insert Element at the End
2.Insert Element at the Front
3.Delete Element at the End
4.Delete Element at the Front
5.Front Element at Dequeue
6.Last Element at Dequeue
7.Size of the Dequeue
8.Display Dequeue
9.Exit
Enter your Choice: 4
Element 34 deleted

1.Insert Element at the End
2.Insert Element at the Front
3.Delete Element at the End
4.Delete Element at the Front
5.Front Element at Dequeue
6.Last Element at Dequeue
7.Size of the Dequeue
8.Display Dequeue
9.Exit
Enter your Choice:

*/

2nd Year COMP/IT (SPPU)