i need solution very very quickly please
#data structure in c++#
#the question below#
The cafeteria in a university decided to make Black Friday, each student can take at most 3
items from the cafeteria, if the student has an average greater than or equal 90, he can take all his items
for free and if the average between 60 and 89 the student can take 1 item only as free from his items,
otherwise the student should pay for the items. before the cafeteria opens the door there are many and
many students waiting at the door, the guard decide to order the students about their averages in a priority
queue. So the heist average comes first in the queue.
Notes:
- The student object consists of ID, Name, average and number of buying items between (0,3) items
- The number of the students should be created randomly and must be less than 100 students
- The number of buying items and the student average are created randomly.
- The cafeteria has random number of items less than 200
- The price of each item in the cafeteria is 10$
Create the above queue and find the following
1. Print the students in the priority queue
2. Print the total amount of money that the cafeteria sell.
3. Print the number of students that don’t buying any item
4. Find if there is a student that buying some of his items and the others are not.
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images
- ✓ Allowed languages C Problem Statement Write a C Program that will compute for the GCD of M numbers Input Input starts with a number N and is followed by N sets of numbers (M, A₁, A₁,...AM). We need to compute for the GCD of A₁, A₂....AM Output The set of N numbers indicating the GCD of each of the inputs Limits 1arrow_forwardData Structure Using C++ (Queue) C++ code (NOT JAVA C++ JUST) C++ PROGRAMMING LANGUAGE PLEASE :: We can use a queue to simulate the flow of customers through a check-out line in a store. In this simulation we will have the following details: one check-out line the expected service time for each customer is one minute (However, they may have to wait in line before being serviced) between zero and two customers join the line every minute We can simulate the flow of customers through the line during a time period n minutes long using the following algorithm: Initialize the queue to empty. for ( minute = 0 ; minute < n ; ++minute ) { if the queue is not empty, then remove the customer at the front of the queue. Compute a random number k between 0 and 3. If k is 1, then add one customer to the line. If k is 2, then add two customers to the line. Otherwise (if k is 0 or 3), do not add any customers to the line. } In addition, the algorithm will keep track…arrow_forwardProblem Statement: An election is a formal group decision-making process by which a population chooses a candidate by casting votes. Each candidate is assigned name and a specific symbol. A ballot paper is used to cast the vote. Each ballot paper contains symbols of the candidate. A person can vote a candidate by stamping on a specific symbol. The ballot paper should be considered as a spoilt ballot if a person does not stamp or stamp on more than one symbol. Finally ballot paper has to be dropped in a ballot box. Write a C++ program that reads the information from the user to enter the name of the candidate, the total number of received votes, and the spoilt votes in a local election. The total number of participants (candidates) are 5. If the user mistakenly enters any negative value, the program should consider that value as a positive integer. The program should output the name, total received votes, and the percentage of obtained votes by the winning candidate. The program should…arrow_forwardProblem: UMLThis exercise is for a simplified supermarket cash register system. The normal procedure for using the cash register is as follows:• A customer arrives at the checkout with items to pay.• The cashier records the identification number of each item, as well as the quantity if it is greater than one.• The checkout displays the price of each item and its description.• When all purchases are recorded, the cashier signals the end of the sale.• The cash register displays the total purchases.• The customer chooses his method of payment:✓ cash: the cashier collects the money received; the cashier indicates the currency to be returned to the customer;✓ check: the cashier checks the creditworthiness of the customer by transmitting a request to an authorization center via the cashier;✓ credit card: a bank terminal is part of the cash register. It transmits an authorization request to an authorization center according to the type of card.• The cash register registers the sale and prints…arrow_forwardContext: Measuring Air Quality Levels of various air borne pollutants such as Nitrogen Monoxide (NO), Nitrogen Dioxide (NO2) and particulate matter (also called particle pollution) are all major contributors to the measure of overall air quality. For instance, NO2 is measured using micrograms in each cubic metre of air (㎍/m3). A microgram (㎍) is one millionth of a gram. A concentration of 1 ㎍/m3 means that one cubic metre of air contains one microgram of pollutant. To protect our health, the UK Government sets two air quality objectives for NO2 in their Air Quality Strategy The hourly objective, which is the concentration of NO2 in the air, averaged over a period of one hour. The annual objective, which is the concentration of NO2 in the air, averaged over a period of a year. The following table shows the colour encoding and the levels for Objective 1 above, the mean hourly ratio, adopted in the UK. Index 1 2 3 4 5 6 7 8 9 10 Band Low Low Low Moderate Moderate Moderate High…arrow_forwardSub- CSEarrow_forwardarrow_back_iosarrow_forward_ios
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education