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 Named 'Rectangle' With Two Data Members 'Length' And 'Breadth' And Two Methods To Print The Area And Perimeter Of The Rectangle Respectively. Its Constructor Having Parameters For Length And Breadth Is Used

Explain the use of the binary heap as an effective implementation for a priority queue .


a. Describe the concept of a Binary heap and the heap order property.


1.Create a class to implement a queue using a circular array<o:p></o:p>

 a. The class should contain functions to

 i. Insert a new value

 ii Delete a value.

 iii. Change a value equal to X to a value equal to Y.

 iv. Count all value equal to X in the queue.

For each function above perform an asymptotic analysis and state the worst case performance of the algorithm


Develop a program called National_lottery that determines the winning lottery numbers. The program must use the rand function to produce six(6) random numbers between 0 & 49 & number must not repeat. The numbers are generated by a user by clicking a button called Generate six(6) numbers.

-Then use an appropriate pointer operator to print the addresses of the numbers in memory & must be expressed in hexadecimals.

-use the derefencing operatorto point to values contained within the addresses. Use the function sort with begin() & end() function.

-Then assign the values into an array called winning_numbers. Use the for statement or the initialiser list to initialise the numbers into the array. Search the winning_numbers for any two(2) array elements(subscripts) that give the sum of >= 80 when added together, if the numbers >= 80 are more than one(1) set, consider the biggest set to be the one chosen for draw


2. In Q1, add default as well as parameterized constructors in both base & derived class. Create object of Alarm_Clock class. Make it to call parameterized constructors of base as well as derived. Add destructors also. Check the order of destructors when derived class object goes out of scope.
Implement a single inheritance program where base class is Clock & derived class is Alarm_Clock . Base class should have at least one member with private access, one member with protected access, one with public access. Clearly differentiate between different access specifiers. While designing classes make sure you add valid data members & member functions. Also try to analyze the difference between private, public & protected mode of inheritance.

3 Create a class called 'TIME' that has three integer data members for hours, minutes and seconds, a constructor to initialize the object to some constant

value, member function to add two TIME objects, member function to

display time in HH:MM:SS format. Write a main function to create two

TIME objects, add them and display the result in HH:MM:SS format.


Sample Run 1

Welcome to CS126 Mart!

Item Codes Description Price

100 Sweet ‘n Ripe Grapes 125.35

101 Crunchy Apples 52.20

109 Green Peas 25.75


Enter Code: 128

Invalid code. This program will exit.


Sample Run 2

Welcome to CS126 Mart!

Item Codes Description Price

100 Sweet ‘n Ripe Grapes 125.35

101 Crunchy Apples 52.20

109 Green Peas 25.75


Enter Code: 100

Sweet ‘n Ripe Grapes 125.35

Quantity -3

Invalid quantity


You are given a side of a square as input. Write a program to find the perimeter and area of the square.

Input

The input is an integer representing the length of the side of the square.

Output

The first line of the output should contain area of the square, and the second line of the output should contain the perimeter of the square as per the format shown in the sample output.

Explanation

Given the length of the side is

2. As the area of square is

side*side and the perimeter of the square is 4*side.Then output should be


LATEST TUTORIALS
APPROVED BY CLIENTS