Questions: 652

Answers by our Experts: 652

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

Create a class to implement a queue using a circular array[20 marks]




a. The class should contain functions to



i. Insert a new value, [5 marks]




ii. Delete a value. [5 marks]




iii. Change a value equal to X to a value equal to Y. [5 marks]




iv. Count all value equal to X in the queue. [5 marks]




b. For each function above perform an asymptotic analysis and state the worst case performance of the algorithm[5 marks]





While purchasing certain items, discount is offered based on the below conditions. If quantity and price per item are input through the keyboard, write a pseudo code and draw a flowchart to calculate the total expenses.

Purchase of item above or equal to 6000 – 15 % discount Purchase of item between 5000 and 5999 - 12 % discount Purchase of item between 4000 and 4999 - 08 % discount Purchase of item less than 4000 – 03 % discount


While purchasing certain items, discount is offered based on the below conditions. If quantity and price per item are input through the keyboard, write a pseudo code and draw a flowchart to calculate the total expenses.


Problem: A company plans to pay bonus to their employees, the details are given


below:


• Those earning Rs. 30,000 or above are to be paid 20 percent of their


salary.


• Those earning less than Rs. 30,000 are to be paid Rs. 1000


• The input records contain the employee number, name and salary of


the employees.


• The output to be printed should contain the employee number,


name, amount of bonus and new salary to be paid to each employee.

Develop an attack tree to board a train without paying.


#include<iostream>

using namespace std;

int main(){

double speed = 55;

double hours = 4;

double distance = 0;

double i = 0.5;

while(i<=hours){

distance = distance + (speed / 2);

cout<<i<<endl;

cout<<"Distance:  "<<distance<<endl;

i += 0.5;

}

}


Draw a flowchart that displays 3 inputted numbers in ascending order.





The challenge is to find all the pairs of two integers in an unsorted array that sum up to a given S.




For example, if the array is [3, 5, 2, -4, 8, 11] and the sum is 7, your program should return [[11, -4], [2, 5]] because 11 + -4 = 7 and 2 + 5 = 7.


A school has 1800 students. The start date and leaving date for each student is stored on file. Dates are in the format YYMMDD (e.g. a student starting on 10th September 2007 and leaving on 4th August 2012 has the data 070910 and 120804 on file).

(a) Write an algorithm, using pseudocode or otherwise, which

• inputs Student ID for all 1800 students

• inputs the start date and leaving date for each student

• carries out a check to ensure the second date is later

• if error, increments error counter

• outputs the number of errors 


Tony is writing a program to calculate a player's score in a dice game. A player starts with a score of 0 and rolls a dice, numbered 1 to 6, as many times as they want. After each roll they add the number the dice lands on to their score. The aim is to get as close to 21 as possible. If you go over 21 you get a score of 0. Write Tony's program as an algorithm. 



LATEST TUTORIALS
APPROVED BY CLIENTS