Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Two brackets are considered to be a matched pair if the an opening

bracket (i.e., (, [, or { ) occurs to the left of a closing bracket (i.e., ),

], or }) of the exact same type. There are three types of matched

pairs of brackets: [], {}, and (). A matching pair of brackets is not

balanced if the set of brackets it encloses are not matched. WAP to

determine whether the input sequence of brackets is balanced or not.

If a string is balanced, it print YES on a new line; otherwise, print

NO on a new line.

Example: Input: {[()]} and Output: YES

Input: {[(])} and Output: NO


WAP to convert an infix expression into its equivalent prefix

notation.


WAP to convert an infix expression into its equivalent postfix

notation.


Write a menu driven program to perform the following

operations of a stack using linked list by using suitable user defined

functions for each case.


Write a menu driven program to perform the following

operations of a stack using array by using suitable user defined

functions for each case.

a) Check if the stack is empty b) Display the contents of stack

c) Push d) Pop


Find and display the values of both sides of the following mathematical series expression and

an absolute difference of both sides. User can input either of angles in degree 90, 60, 30 etc.


sin(x) = x −

x

3

3!

+

x

5

5!

x

7

7!

+

x

9

9!


Q2: Answer the questions (i) and (iii) after going through the following class:
class Seminar
{
int time;
public:
Seminar() //Function 1
{
time = 30;
cout << "Seminar starts now" << endl;
}
void lecture() //Function 2
{
cout << "Lectures in the seminar on" << endl;
}
Seminar(int duration) //Function 3
{
time = duration;
cout << "Seminar starts now" << endl;
}
~Seminar() //Function 4
{
cout << "Thanks" << endl;
}
};
i. Write statements in C++ that would execute Function 1 and Function 3 of class Seminar.
ii. In Object Oriented Programming, what is Function 4 referred as and when does it get invoked/called?
iii. In Object Oriented Programming, which concept is illustrated by Function 1 and Function 3 together?
1. Here is a list of integers. Find the elements that are the square of any number m.
2. The sequence of natural numbers a1, a2, ..., an is given. Replace the terms greater than the given number Z. with this number. Calculate the number of substitutions.
3. The sequence of natural numbers a1, a2, ..., an is given. There are positive and negative elements in the chain. Calculate the product of negative elements P1 and the product of positive numbers P2. Compare the modules P2 and P1, indicate which of the modulus is greater.

Your task is to then create a java program that when given an acronym with its meaning plus some sentence, the program replaces the first occurrence of the acronym in the sentence with its meaning.

 Sample run 1: 

Enter an acronym and its meaning (separated by spaces): NUST Namibia University of Science and Technology                               

Enter a sentence: Welcome to my NUST.                                                            Output: Welcome to my Namibia University of Science and Technology.

Given a number N, create a 2D arrays with n rows and n columns. Now inspect the matrix pattern below and come up with a formula to populate the array for any give NXN matrix.

5      4      3    2   1

10    8      6    4   2

15   12     9    6   3

20   16    12   8   4

25    20   15  10  5


LATEST TUTORIALS
APPROVED BY CLIENTS