List the output of the following program segment. If an error is contained in the program,please mark and explain the error. For the rest of the program, assume that all lines with an error are removed from the program.
#include<iostream.h>
class Node{
public: double data
private: Node *next;
};
int main(void){
double *px,*py;
double x,y;
Node *p,*q,*r;
x=9.5;
y=-2.0;
px=8.6;
*px=10.0;
*x=*px;
x=*px;
py=&y;
p=new Node();q=new Node();r=new Node();
p->data=1.0;
q->data=2.0;
r->data=3.0;
p->next=q;
q->next=r;
r->next=p;
cout<<*px<<endl;
cout<<x<<endl;
cout<<*py<<endl;
cout<<q->next;
cout<<p->next->next->next->next->data<<endl;
delete q;
cout<<p->next->next->next->next->data<<endl;
return 0;
}
An events ticket booking System prompts the user to make a choice as well as the number of tickets required. It then displays the total cost of the order. The menu options and cost per ticket is as follows: 1 Exclusive VIP area A : R3 000.00 2 VIP area B : R2 000.00 3 Elevated area :R1200.00 4 General area R600. 0 QUIT
Create an AVL tree with the following keys,clearly show visually each step.Each step wil contain a mark.
12,33,44,43,99,0,88,13,43,2,222
Convert the expression into postfix notation and then verify if it is correct or not,direct answers for both 5conversion are not allowed for verification take dummy values for eachvariable.
a+b*(c/d-e)%(f+g*h)-i
Note:
1)No code is required.
Convert the follwoing expressio to postfix notation. Show the state of stack and expression after each step.
( ( 2 * ( 6 + 3 ) ) / ( 4 - 6 + 4 ) ) / 5
Note:
1)no code is required.
Convert the given postfix expression into equivalent infix expression.Show all steps ,no marks will be given for direct answer.
a b + c -d e * /
the out put should be 12x^4 + 9x^3 - 5x^2 - x - 1 but our code does not give this out put