Perform surgeries for back and heart

Assignment Help C/C++ Programming
Reference no: EM133201523

A function named surgerySelector that receives a vector of Hospital as the parameter (std::vector) and returns Hospital. This functions performs the following tasks:

  1. Print how many hospitals can perform surgeries for back and heart.
  2. Print to the screen the name(s) of hospital(s) and surgeries whose price is below 80000.
  3. Calculate and print to the screen the average price for 'back' surgeries.
  4. Print if any hospital(s) which is/are not equipped for any surgery. Print 'Yes' if there are any or 'No' in the other case. Also print the number of hospitals you found in either case.
  5. Sort the vector of Hospitals with prices low to high

    *** Do not use Manual loops!

    *** Do not use the same algorithm more than once!
    
#include <iostream>
#include <vector>
#include <string>
#include <list>
#include <algorithm>
#include <numeric>

using namespace std;
enum class surgery_type
{
    back, brain, heart
};
struct Hospital
{
    std::string name;   
    surgery_type type; 
    bool equipped;
    double price;
};

Hospital surgerySelector(vector<Hospital> perform) {


//your code here

    return hh;
}

int main() {
    std::vector<Hospital> performSurgery({
        { "Stouville", surgery_type::back, true, 30000.00},
        { "Scarbrough", surgery_type::back, false, 25000.00},
        { "Scarbrough", surgery_type::brain, false, 100000.00 },
        { "Toronto", surgery_type::brain, true, 105000.00},
        { "Toronto", surgery_type::back, true, 40000.00 },
        { "Toronto", surgery_type::heart, true, 49000.00 },
        { "Stouville", surgery_type::heart, true, 45000.00 },
        });

    auto res = surgerySelector(performSurgery);

    return 0;
}

Reference no: EM133201523

Questions Cloud

Describe ethnocentrism and prejudice : Define culture and explain the terms related to culture. Define and describe ethnocentrism and prejudice. Give personal examples to support your descriptions.
Mips assembler program : You have been given 21t3final_q3. s, a MIPS assembler program that reads an integer value and then prints it. Add code to the file 21t3final_q3.s
Writing a function called process : You run a side hobby of repairing old retro tech. Your business is growing, and you want to add a bit more automation to help your billing system.
Overview of the history of knowledge management : Explain the concept of knowledge management. Provide an overview of the history of knowledge management. (300-400 words)
Perform surgeries for back and heart : A function named surgerySelector that receives a vector of Hospital as the parameter (std::vector) and returns Hospital. This functions performs the following t
Explain the specific experimental design : BIO 120-Grossmont College-Explain the specific experimental design used to figure out the role of camouflage in the mouse populations
Look at an item around your house : University of Southern California - Look at an item around your house, for example a coke can (and now you can't use a coke can--nor any other soft drink can)
What are things you need to keep in mind and you manage well : When you are marketing internationally, what are the things you need to keep in mind and you must manage well?
Discuss why managers estimate a cost function : Discuss why managers estimate a cost function and use Cost volume Profit analysis? Give numerical example of cost function and Cost Volume Profit Analysis

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Function that accepts a score for a driver''s license

Write a function that accepts a score for a driver's license facility, an int or a float, and returns a letter. If the score passed in is less than 75, then the letter returned is an F for Fail. Otherwise, the letter returned is a P for Pass.

  Describe what an attribute or data member of a class

Analyze a basic set of requirements for a problem - Describe what an attribute or data member of a class - Distinguish between pass-by-value and pass-by-reference

  AACS1074 Programming Concepts and Design Assignment

AACS1074 Programming Concepts and Design Assignment Help and Solution - Apply the programming concepts and skills that you learnt to write

  Economy of kenya has a budget deficit

The economy of Kenya has a budget deficit of KSH 500B. This deficit is likely to be funded through domestic borrowing and taxation. Using an appropriate model, explain the macroeconomic implications of such a move.

  Identify the infrastructural requirements and security issue

Create a presentation or written report describing each company (take a screenshot of each, if possible), and explain why it fits into the category of e-commerce to which you have assigned it - what do you believe are the major advantages and disad..

  Basic game of battleship

Basic Game of Battleship - Analyze a basic set of requirements and apply top-down design principles for a problem and eliminate redundancy within a program by applying loops and functions

  Create a studentgrade class that includes two data members

Create a StudentGrade class that includes two data members: a student ID number and the student's score on a test. Both of these are integers. Include "get" and "set" member functions for each of the data members, plus a displayRecord method which ou..

  Overview of the system with actors and use cases

Examine the website stayz.com.au and identify the actors and use cases involved in using the system for rental properties. You should also create a simple use case diagram showing an overview of the system with actors and use cases.

  Computes the average of five exam scores

Write a program that calculates and prints the take-home pay for a commissioned sales employee and write a program that computes the average of five exam scores.

  Create a threaded chat server and corresponding chat client

Create a threaded chat server and a corresponding chat client. Using the port of your choice, create a server that starts a new thread.

  Take the code you wrote for the ford-fulkerson algorithm

Take the code you wrote for the Ford-Fulkerson algorithm for the maximum flow on a directed graph with capacities, and implement scaling on top of this code. You write a function

  Write a c function tconvert

Write a C function, tconvert, with the following definition: float tconvert(int towhat, float temp)

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd