Posts

How to Solve the equations in Assembly language in MIPS on Mars

  Solve Equation in MIPS Task 1: Write a program to solve the following 3.5*2-2+2 .data: num1f:.float 3.5 num2f:.float 2 num3f:.float 2 num4f:.float 2 .text: main: lwc1 $f0,num1f lwc1 $f1,num2f lwc1 $f2,num3f lwc1 $f3,num4f mul.s $f4,$f0,$f1 sub.s $f5,$f4,$f2 add.s $f6,$f5,$f3 li $v0,2 mov.s $f12,$f6 syscall li $v0,10 syscall Task 2: Write a program to solve the following 7/4*1-3+7 .data num1:.float 7 num2:.float 4 num3:.float 1 num4:.float 3 num5:.float 7 .text lwc1 $f0,num1 lwc1 $f1,num2 lwc1 $f2,num3 lwc1 $f3,num4 lwc1 $f4,num5 div.s $f5,$f0,$f1 mul.s $f6,$f5,$f2 sub.s $f7,$f6,$f3 add.s $f8,$f7,$f4 li,$v0,2 mov.s $f12,$f8 syscall

Addition, Subtraction, Multiplication and solving equation in Assembly language (MIPS) on Mars

  Use of Operands Task 1: Write a program to add an Integer values in MIPS Assembly language. .data num1:.word 5 num2:.word 7 .text lw $t0,num1 lw $t1,num2 add $t3,$t0,$t1 li,$v0,1 move $a0,$t3 syscall Task 2: Write a program to Subtract an Integer values in MIPS Assembly language. .data num1:.word 5 num2:.word 7 .text lw $t0,num1 lw $t1,num2 sub $t3,$t0,$t1 li,$v0,1 move $a0,$t3 syscall Task 3: Write a program to Multiply an Integer values in MIPS Assembly language. .data num1:.word 5 num2:.word 7 .text lw $t0,num1 lw $t1,num2 mul $t3,$t0,$t1 li,$v0,1 mflo $a0 syscall Task 4: Write a program to Divide an Integer values in MIPS Assembly language. .data num1:.word 10 num2:.word 5 .text lw $t0,num1 lw $t1,num2 div $t3,$t0,$t1 li $v0,1 mflo $a0 syscall Task 5: Write a program to solve this equation 2+3-4*2 by using registers in MIPS A

Print "Hello World" and printing integer || float || double numbers in Assembly language(MIPS) on Mars

  How to print in MIPS on MARS Task 1: Write a program to print an Integer on Mars Simulator. .data num:.word 10 .text li $v0,1 lw $a0,num syscall Task 2: Write a program to print a character on Mars Simulator. .data a:.byte 'a' .text li $v0,4 la $a0,a syscall Task 3: Write a program to print a float number on Mars Simulator. .data numf:.float 1.5 .text li $v0,2 lwc1 $f12,numf syscall Task 4: Write a program to print a double number on Mars Simulator. .data numd:.double 11.5587 .text li $v0,3 ldc1 $f12,numd syscall Task 5: Write a program to print a message: “I Love Pakistan” on Mars Simulator. .data abc:.asciiz "i love pakistan" .text li $v0,4 la $a0,abc syscall

Postfix,Prefix and evaluation of postfix code in Data Structures using stack

  Post-fix  + Prefix + Evaluation of Post-fix Post-fix  Algorithm Infix to Postfix Conversion (Algorithm): (Pseudocode) 1)  Examine the next element in the input. 2)  If it is operand, output it. 3)  If it is opening parenthesis, push it on stack. 4)  If it is an operator, then 4.1) If stack is empty, push operator on stack. 4.2) If the top of stack is opening parenthesis, push operator on stack 4.3) If it has higher priority than the top of stack, push operator on stack. 4.4) Else pop the operator from the stack and output it, repeat step 4 5)  If it is a closing parenthesis, pop operators from stack and output them until an opening  parenthesis is encountered. pop and discard the opening parenthesis. 6)  If there is more input go to step 1 7)  If there is no more input, pop the remaining operators to output.   For example, Suppose we want to convert 2*3/(2-1)+5*3 into Postfix form, prefix  Algorithm The only difference in prefix function is the reverse

Implementation of Double link list in c++

Implementation of Double link list in c++  #include<iostream> using namespace std; struct Node { int data; Node* next; Node* prev; }; Node* first = NULL; Node* last = NULL; void insertAtLast(int val) { Node* new_node = new Node; new_node->data = val; if (last == NULL) { new_node->next = new_node->prev = NULL; first = last = new_node; } else { new_node->next = NULL; new_node->prev = last; last->next = new_node; last = new_node; } } void insertAtFirst(int val) { Node* new_node = new Node; new_node->data = val; if (first == NULL) { new_node->next = new_node->prev = NULL; first = last = new_node; } else { new_node->prev = NULL; new_node->next = first; first->prev = new_node; first = new_node; } } void traverseFirst() { Node* new_node = new Node; new_node = first; while (new_node != NULL) { cout << new_node->data << "

Airline Management System with Double link list in c++

Airline Management System with Double link list in c++ #include<iostream> #include<string> #include<ctype.h> #include<cstring> using namespace std; struct Person{ string name; int age; string cnic; int TicketNo; string FlightNo; }; struct Cust{ Person obj; Cust *next; Cust *pre; }; Cust *firstC = NULL; Cust *lastC = NULL; struct Flight{ Cust *head; Flight *next; Flight *pre; string name; void ReserveFromF() { system("cls"); Cust *newNode = new Cust; cout << "Enter the name of the customer:"; getline(cin, newNode->obj.name); cout << "Enter the CNIC number:"; getline(cin, newNode->obj.cnic); cout << "Enter the flight number:"; getline(cin, newNode->obj.FlightNo); cout << "Enter the Age of the customer(int):"; cin >> newNode->obj.age; cout << "Enter the Ticket Number(int):"; cin >

Implementation of single link list c++

 Implementation of single link list c++ #include<iostream> using namespace std; struct Node{ int value; Node *next; }; Node *head=NULL; void insert(int a) { Node *temp = new Node; temp->value = a; if (head == NULL) { temp->next = NULL; head = temp; cout << "Value was null" << endl; } else { temp->next = head; head = temp; cout << "Value is not null" << endl; } } void display() { Node *temp = new Node; temp = head; while (temp != NULL) { cout << temp->value << endl; temp = temp->next; } } int main() { insert(5); insert(6); insert(7); display(); getchar(); return 0; }

Stack using single link list in c++

 Stack using single link list in c++ #include<iostream> using namespace std; class Pile{ public: int plate; Pile *next; Pile *top = NULL; void push(int val) { Pile *temp = new Pile; temp->plate = val; temp->next = top; top = temp; } int pop() { if (isEmpty()) { cout << "There is no plate" << endl; return 0; } else { Pile *temp = top; top = top->next; delete(temp); return top->plate; } } bool isEmpty() { return (top == NULL); } int peek() { if (isEmpty()) { cout << "There is no plate" << endl; return 0; } else { return top->plate; } } }; int main() { Pile blue; blue.push(5); blue.push(55); blue.push(11); blue.pop(); blue.pop(); cout << "Value is:" << blue.peek() << endl; getchar(); getchar(); return 0; }

Implementation of Stack using Arrays c++

 Implementation of Stack using Arrays c++ #include<iostream> using namespace std; #define Max 10 class Stack{ int top = -1; public: int stack[Max]; bool push(int val) { if (isFull()) { cout << "Stack is full" << endl; return false; } else { stack[++top] = val; return true; } } int pop() { if (isEmpty()) { cout << "Stack is empty" << endl; return 0; } else { int a = stack[top--]; return a; } } bool isFull() { return (top > Max - 1); } bool isEmpty() { return (top < 0); } int peek() { if (isEmpty()) { cout << "Stack is empty" << endl; } else { int a = stack[top]; return a; } } }; int main() { Stack s1; s1.push(5); s1.push(2); cout<<s1.pop(); getchar(); getchar(); return 0; }

Ticket Management System using link list

Ticket Management System using link list   #include<iostream> #include<string> #include<cstring> #include<ctype.h> using namespace std; class Ticket { public: int ticketNo, seatNo, AirNo; string cnic, ticketDate; string FName; Ticket *next; Ticket() { FName= '\0'; cnic = ticketDate = " "; ticketNo = seatNo = AirNo = 0; } }; Ticket *head = NULL; int position=0; class Airline{ public: void ResTicket() { system("cls"); Ticket *Node = new Ticket; cout << "Enter the ticket number(integer):"; cin >> Node->ticketNo; cout << "Enter the Airline number(integer):"; cin >> Node->AirNo; cout << "Enter the seat number(integer):"; cin >> Node->seatNo; cin.ignore(); cout << "Enter the Name:"; getline(cin, Node->FName); cout << "Enter the CNIC:"; getline(cin, Node->cnic); cout &

Library Management System using Single Link list

 Library Management System using Link list #include<iostream> #include<string> using namespace std; class Books{ public: int ISBN; string Name, AName, PName, IDate, RDate; Books *next; Books() { ISBN = 0; Name, AName, PName, IDate, RDate = " "; } }; class Library{ public: Books *head = NULL; int size; void CreateBook() { cout << "How many books do you want to enter:"; cin >> size; cin.ignore(); for (int i = 0; i < size; i++) { cout << endl << endl; Books *tempBook = new Books; cout << "Enter the isbn number of book(in int):"; cin >> tempBook->ISBN; cin.ignore(); cout << "Enter the name of the book:"; getline(cin, tempBook->Name); cout << "Enter the auther name of the book:"; getline(cin, tempBook->AName); cout << "Enter the publisher name of the author:"; getline(cin, tempBook->PN

Employee and Customer Management System using single link list

Customer and Employee Management System using link list  #include<iostream> #include<string> using namespace std; class Customer{ public: int custCnic; string custName, custAdress,custPhone,custType; Customer *custNext; Customer() { custCnic = 0; custName = custAdress = custPhone = custType = " "; } Customer(int cnic, string name, string adress, string phone, string type) { custCnic = cnic; custName = name; custAdress = adress; custPhone = phone; custType = type; } }; class Employee{ public: int empCnic; string empName, empAdress, empPhone, empType; Employee *empNext; Employee() { empCnic = 0; empName = empAdress = empPhone = empType = " "; } Employee(int cnic, string name, string adress, string phone, string type) { empCnic = cnic; empName = name; empAdress = adress; empPhone = phone; empType = type; } }; class DSA{ public: Customer *custHead = NULL; Employee *empHead = NULL; void insertCust() { Customer *temp

Library Management System

Library Management System   #include<iostream> #include<string> using namespace std; class Library{ int books; string name, author, publisher, issueDate, returnDate; int isbnNo; public: void create() { cout << "Enter the name of the book:"; getline(cin, name); cout << "Enter the author name:"; getline(cin, author); cout << "Enter the ISBN number(in integer):"; cin >> isbnNo; cin.ignore(); cout << "Enter the publisher name:"; getline(cin, publisher); cout << "Enter the issue date:"; getline(cin, issueDate); cout << "Enter the return date:"; getline(cin, returnDate); } void retrieve(Library *l, int size, int a) { int count = 0; for (int i = 0; i < size; i++) { if (l[i].isbnNo == a) { l[i].author = " "; l[i].books = l[i].books - 1; l[i].isbnNo = 0; l[i].issueDate = " "; l

Employee and Customer Management System C++

Image
Management System(Employee and Customer)   #include<iostream> #include<string> using namespace std; class Customer{ public: string custName, custAdress, custType,custPhone; int custCnic; Customer(){ custName = custAdress = custType=custPhone = "0"; custCnic = 0; } Customer(string a, string b, string c,string d, int e) { custName = a; custAdress = b; custType = c; custPhone = d; custCnic = e; } }; class Employee{ public: string empName, empAdress, empType,empPhone; int empCnic; Employee(){ empName = empAdress = empType,empPhone = "0"; empCnic = 0; } Employee(string a, string b, string c,string d, int e) { empName = a; empAdress = b; empType = c; empPhone = d; empCnic = e; } }; class DSA{ public: void Create(Employee *e, int size) { for (int i = 0; i < size; i++){ cout << endl; cout << "Please enter the cnic number for Employee(in integer):";

Earning by using a simple app

Image
 earning by using a simple app It is very easy to earn in this era because this is the time of technology and internet so therefore this advancement offers the new jobs for everyone and for free For example online stores offers affiliation for everyone not only this this also offer the online marketing jobs and many more but earn by playing game true? Whatever this this but our today blogs is about the app named as bitcoin blast. I will tell you everything clearly in this blog according to my experience. So lets start my experience and than you should select the side that is this true or not?                                                                         So i am starting my story about the app that how i started to earn from the app or is i really earn? and answer of it this in this kind that yes i earn and i got 0.01 dollar per game in 2 days. I download the game and than i play a game and i got about 8000 points and i withdraw these points into the money and i got the withdr