4 // Fruit preferences: You need to display which fruits each person likes and who likes the most fruits. // Required output: // A likes: Apple, Mango, Orange, // F likes: Grapes, Mango, Lychee,...


This one in c++ using below code.


4<br>// Fruit preferences: You need to display which fruits each person<br>likes and who likes the most fruits.<br>// Required output:<br>// A likes: Apple, Mango, Orange,<br>// F likes: Grapes, Mango, Lychee, Cherry, Dragon Fruit, Apple,<br>// B likes: Plum, Peach, Lychee,<br>// c likes: Orange, Apricot,<br>// D likes: Apple, Mango,<br>// E likes: Grapes, Dragon Fruit,<br>// H likes: Cherry,<br>// F likes the most fruit<br>7<br>8<br>9<br>10<br>11<br>12<br>13<br>14<br>15<br>// Note that your output must EXACTLY MATCH the required output<br>provided<br>16<br>NO HARDCODING<br>- -<br>

Extracted text: 4 // Fruit preferences: You need to display which fruits each person likes and who likes the most fruits. // Required output: // A likes: Apple, Mango, Orange, // F likes: Grapes, Mango, Lychee, Cherry, Dragon Fruit, Apple, // B likes: Plum, Peach, Lychee, // c likes: Orange, Apricot, // D likes: Apple, Mango, // E likes: Grapes, Dragon Fruit, // H likes: Cherry, // F likes the most fruit 7 8 9 10 11 12 13 14 15 // Note that your output must EXACTLY MATCH the required output provided 16 NO HARDCODING - -
18<br>#include <iostream><br>19<br>#include <vector><br>20<br>#include <tuple><br>21<br>auto alreadychecked(...) //Hint: try using a string and a vector<br>{<br>// checks if a specific person's preference have already been<br>22<br>23<br>24<br>taken into account<br>25<br>}<br>26<br>auto likedFruits(...)<br>{<br>// returns which fruits a specific person likes<br>}<br>27<br>28<br>29<br>30<br>31<br>32<br>int main()<br>33<br>{<br>auto fruitPref = std::vector<std::tuple<std::string,<br>std::string>>({<br>{

Extracted text: 18 #include 19 #include 20 #include 21 auto alreadychecked(...) //Hint: try using a string and a vector { // checks if a specific person's preference have already been 22 23 24 taken into account 25 } 26 auto likedFruits(...) { // returns which fruits a specific person likes } 27 28 29 30 31 32 int main() 33 { auto fruitPref = std::vector<>>({ {"A", "Apple"}, {"F", "Grapes"}, {"A", "Mango"}, {"B", "Plum"}, {"F", "Mango"}, {"C", "Orange"}, {"A", "Orange"}, {"D", "Apple"}, {"B", "Peach"}, {"c", "Apricot"}, {"D", "Mango"}, {"E", "Grapes"}, {"B", "Lychee"}, {"F", "Lychee"}, {"F", "Cherry"}, {"E", "Dragon Fruit"}, {"F", "Dragon Fruit"}, {"F", "Apple"}, {"H", "Cherry"} }); 34 35 36 37 38 39 40 41 //HINT: consider maintaining a vector with names of people already done to avoid repetition in result 42
Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here