Questions: 11 448

Answers by our Experts: 10 707

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

Map ADT using a binary search tree. The implementation must be a class template that has all the Map ADT functions:

  • size() -- return number of entries
  • empty() -- true if map empty, flase otherwise
  • find(k) -- find the given key
  • put(k, v) -- put key-value pair
  • erase(k) -- erase by key
  • erase(p) -- erase by iterator p
  • begin() -- iterator to beginning
  • end() -- iterator to the sentinel

Write a program, using functions only, with the following features.


1. Program reads paragraph(s) from the file and stores in a string.


2. Then program counts the occurrence of each word in the paragraph(s) and stores all


words with their number of occurrences.


3. If that word has appeared more than one time in whole string, itshould store the word


only once along its total number occurrences.


4. The output described in above (int part 3) must be stored in a new file.

Write a simple bus seat reservation program. The bus has 10 rows, with 4 seats in each row. The program should perform the following: Step 1. The program should ask the user to enter what row and seat number to reserve. Indicate an ‘X’ mark if the seat is reserved. Step 2. Repeat Step 1; the program will stop until the user enters a negative number.


ACTIVITY Write a program using queues with the output and requirements shown below: a. 4 Include Library b. For Loop c. While Looping d. Switch Case not allowed e. 10 QUEUE Container f. You can use String data Type g. #define SIZE 10 h. Function Needed 1. Empty(); 2. Full(); 3. Enqueue(); 4. Dequeue 5. DisplayFront(); 6. DisplayAll(); 7. (You can make a New Function/Operation if Needed)


Cashier is a C++ program that displays on the screen item codes with corresponding item description and price (at least 3 items). It asks the user to enter the code of the item purchased by a customer. It looks for a match of the item code stored in items.txt. Then, its description and price are displayed on the screen too. Also, it asks for the quantity of the particular item code entered. It displays its subtotal thereafter. Moreover, it keeps on accepting item codes until ‘0’ is pressed. Consequently, it displays the total amount due. Then, it asks the user to tender the amount of cash of the customer. It displays the change, its breakdown and change in words and sends the details of the transaction such as total amount due, amount tendered and change due to customer.txt

Constraints:

• The program should inform the user is “items.txt” does not exist.

• The program should tell the user that the code is not found in “items.txt”.




Create a class called numbers which should hold 10 integer numbers in an array. The array should be private. Now include the following member functions in the class (in addition to any other function that you may deem necessary): (a) sum() which will find the sum of the member elements. (b) average() which will find the average (c) max() which returns the maximum value (d) sort_desc() which will sort the array in descending order.

Write a program that declare an array of size 25 consisting of students’ test scores in the range 0–200. The user may input any score in the array. It should then determine the number of students having scores in each of the following ranges: 0–24, 25–49, 50–74, 75–99, 100–124, 125–149, 150–174, and 175–200. Output the score ranges and the number of students. (Run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157)


The location of a point in two dimensions can be determined either by Cartesian coordinates (x, y) or by polar coordinates (r, θ). Using object oriented programming (i.e., by using classes and objects), write a program which yields polar coordinates of a point when the Cartesian coordinates are given as input by the user. The angle should be given in degrees in the output. Your code should be able to tackle the following cases for θ as well:

get age

get age

if age is less than 18

 status is under age

else

 status is over age

display status


Write a program to calculate mobile phone charges according to the following packages. 1. One Hour Package (Package A): If the customer talks for one hour (60 minutes) then Rs. 10 will be charged for one hour (60 minutes) and Rs. 2 will be charged for every extra minute after 60 minutes. 2. 20 Minutes Package (Package B): Rs. 1 will be charged for the first 20 minutes and for every extra minute Rs. 2.5 will be charged. 3. No Package (Package N): Rs. 2 per minute will be charged.


LATEST TUTORIALS
APPROVED BY CLIENTS