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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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