(Convert pounds into kilograms) Write a program that converts pounds into kilograms. The program prompts the user to enter a number in pounds, converts it to kilograms, and displays the result. One pound is 0.454 kilograms.
Compute the volume of a cylinder) Write a program that reads in the radius and length of a cylinder and computes the area and volume using the following formulas:
area = radius * radius * π
volume = area * length
write an algorithm to read 100 numbers then display the largest
you have to make a data structure for Binary Tree.
You should have at least these three data types in your class of Node, left child
pointer and right child pointer and data.
You will have to make a function that adds a number in its correct location. User will decide where to enter the data, so your program should ask whether to move towards right child or left child
An instructor calculates the grade percentage based on the highest score on a test.
Given the highest score and one student’s score, write a solution to calculate and
print that student’s test percentage.
Represent the following expression by means of binary tree :
a*c/d+(R-5^a*d)/2*x -(-d)
a. Describe the concept of a Binary heap and the heap order property. [10 marks]
b. Explain the use of the binary heap as an effective implementation for a priority queue [10 MARKS]
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.