USING MAP please let me know if you have any questions THIS IS ALL THE INFORMATION GIVEN :(

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

USING MAP please let me know if you have any questions THIS IS ALL THE INFORMATION GIVEN :(

Post by answerhappygod »

USING MAP
Using Map Please Let Me Know If You Have Any Questions This Is All The Information Given 1
Using Map Please Let Me Know If You Have Any Questions This Is All The Information Given 1 (298.56 KiB) Viewed 38 times
Using Map Please Let Me Know If You Have Any Questions This Is All The Information Given 2
Using Map Please Let Me Know If You Have Any Questions This Is All The Information Given 2 (211.39 KiB) Viewed 38 times
please let me know if you have any questions
THIS IS ALL THE INFORMATION GIVEN :(
#include "wrapper.h" #include "CarRecord.h" #include "map\map1.hpp" class vinComparer { public: static Boolean areEqual (Text& lhs, Text& rhs) //! restores lhs, rhs { return (1hs == rhs); }; // areEqual }; Using Map // Key = Text = car VIN // Value = CarRecord typedef Mapl CarMap; int main(int argc, char* argv[]) CarMap mel, mc2; CarRecord carRec; Text vin, vinCopy; Integer z; Boolean b; carto "INCR // Comment: To make this activity more interesting, Map mcl is 'seeded' // with 3 mappings listed below. // Normally it would be empty just after declaration and would be written as follows: // mc1 = { } // A real vin looks like this: WMWRH335X7TJ43830 // But we will use the 1st 3 characters: "WMW" Last Updated: 2/27/2017 // Each tuple in the map is a (k, v) pair. // k = vin //v = CarRecord mc1 = ("WMW", ("WMW", "Mustang", 2, "Yellow", 2012)), ("WBA", ("WBA", "Accord", 4, "Silver", 2005)), ("2G1", ("2G1", "A6", 3, "Orange", 2011)) carRec = ("","",0,"",0) z = 0 vin = vinCopy b = false; **** WHE
Boolean b; carRec.vin = "1HG"; carRec.name = "Charger"; carRec.numberOfDoors = 2; carRec.color = "Red"; carRec.yearManufactured = 2009; vin carRec.vin; mcl.add (vin, carRec); z = mcl.size(); carRec.vin = "19V"; carRec.name = "Acura ILX"; carRec.numberOfDoors = 4; carRec.color="Black"; carRec.yearManufactured = 2013; vin carRec.vin; mcl.add (vin, carRec); vin = "WBA"; bmcl.hasKey (vin); vin = "EK7"; b= mc1.hasKey (vin); vin = "WMW"; mc1.remove (vin, vinCopy, carRec); vin="2G1"; wcout <
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply