0% found this document useful (0 votes)
4 views4 pages

Tabular.datastructure.assignment (1)

The document contains multiple C++ programs that define various data structures, such as maps and vectors, to store and display information about medical tests, medications, vehicle types, courses, and investment types along with their respective values. Each program iterates through the defined data structures and prints the associated values in a formatted manner. The overall structure demonstrates the use of standard libraries and basic programming constructs in C++.

Uploaded by

rajatmittal359
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Tabular.datastructure.assignment (1)

The document contains multiple C++ programs that define various data structures, such as maps and vectors, to store and display information about medical tests, medications, vehicle types, courses, and investment types along with their respective values. Each program iterates through the defined data structures and prints the associated values in a formatted manner. The overall structure demonstrates the use of standard libraries and basic programming constructs in C++.

Uploaded by

rajatmittal359
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1‬

#‭
‭i‬nclude‬
<‭
‭b‬its/stdc++.h‬
>‬

using‬‭
‭ namespace‬‭
std‬
;‬

int‬‭
‭ main‬
(){‬

map‬
‭ <‬
‭ string‬
‭ ,‬
‭ int‬
‭ >‬
‭ test‬
‭ ={‬

{‭
‭"‬‬
Blood Test‬
‭ "‬
‭ ,‬
‭ 120‬
‭ },{‬
‭ "‬
‭ MRI scan‬
‭ "‭
‭,‬‬
800‬
‭ },{‬
‭ "‬
‭ X-ray‬
‭ "‭
‭,‬‬
100‬
‭ },{‬
‭ "‬
‭ Ultra‬

sound‬
‭ "‭
‭,‬‭
1
‬50‬
},{‬
‭ "‬
‭ ECG‬
‭ "‬
‭ ,‬
‭ 200‬
‭ },{‬
‭ "‬
‭ CT Scan‬
‭ "‭
‭,‬‬
700‬
‭ },{‬
‭ "‬
‭ Covid 19Test‬
‭ "‬
‭ ,‭
‭5‬0‬
},{‬
‭ "‬
‭ Urine‬

analysis‬
‭ "‭
‭,‬‬
80‬
‭ },‬

{‭
‭"‬‭
A
‬llery test‬
"‬
‭ ,‬
‭ 300‬
‭ },{‬
‭ "‬
‭ Biospy‬
‭ "‬
‭ ,‬
‭ 900‬
‭ }};‬

for‬
‭ (‭
‭ a
‬uto‬‭
it‬
:‬
‭ test‬
‭ ){‬

cout‬
‭ <<‬
‭ it‬
‭ .‭
‭f‬irst‬
<<‬
‭ "‬‭
‭ "‬<<‬
‭ it‬
‭ .‬
‭ second‬
‭ <<‬
‭ "‬
‭ \n‬
‭ "‬
‭ ;‬

}‬

return‬‭
‭ 0‬;‬

}‬

‭ .‬
2
#‭
‭ i
‬nclude‬<‭
‭b‬its/stdc++.h‬ >‬

using‬‭
‭ namespace‬‭ std‬ ;‬

int‬‭
‭ main‬(){‬

vector‬
‭ <‬
‭ string‬
‭ >‬
‭ Medicinetype‬
‭ ={‬
‭ "‬
‭ Antibiotic‬
‭ "‬
‭ ,‭
‭"‬‬
Pinkiller‬
‭ "‭
‭ ,
‬‬"‬
‭ Antacid‬
‭ "‭
‭,‬‬
"‭
‭A‬ntihistamine‬ "‬
‭ ,‭
‭"‬‬
antidepressant‬
‭ "‬
‭ ,‬
‭ "‭
‭A‬ntiviral‬ "‬
‭ ,‭
‭"‬‬
Anti-Inflamattory‬
‭ "‬
‭ ,‬

"‭
‭V‬accine‬ "‭
‭,‬‬
"‬
‭ Insulin‬
‭ "‬
‭ ,‭
‭"‬‬
Sedative‬
‭ "‭
‭}‬;‬
vector‬
‭ <‬
‭ int‬
‭ >‬
‭ Averagedose‬
‭ ={‬
‭ 500‬
‭ ,‬
‭ 250‬
‭ ,‬
‭ 150‬
‭ ,‬
‭ 100‬
‭ ,‬
‭ 300‬
‭ ,‬
‭ 400‬
‭ ,‭
‭2‬00‬
,‭
‭ 5
‬‬,‬
‭ 40‬
‭ ,‬
‭ 50‬
‭ };‬

vector‬
‭ <‬
‭ pair‬
‭ <‬
‭ string‬
‭ ,‬
‭ int‬
‭ >>‬
‭ Medication‬
‭ ;‬

for‬
‭ (‬
‭ size_t‬‭
‭ i‬=‭
‭0‬‬
;‬
‭ i‭
‭<‬‬
Averagedose‬
‭ .‬
‭ size‬
‭ ();‬
‭ i‭
‭+‬+){‬
Medication‬
‭ .‬
‭ push_back‬
‭ (‬
‭ {‬
‭ Medicinetype‬
‭ [‬
‭ i‬
‭ ],‬
‭ Averagedose‬
‭ [‬
‭ i‭
‭]‬‬
}‬
‭ );‬

}‬

for‬
‭ (‬
‭ auto‬‭
‭ it‬‭
:‬‭
Medication‬
){‬

cout‬
‭ <<‬
‭ it‬
‭ .‭
‭f‬irst‬
<<‬
‭ "‬‭
‭ "‭
<‬<‬
it‬
‭ .‬
‭ second‬
‭ <<‬
‭ "‭
‭\‬n‬
"‬
‭ ;‬

}‬

}‬

‭3.‬

#‭
‭i‬nclude‬
<‭
‭b‬its/stdc++.h‬
>‬

using‬‭
‭ namespace‬‭
std‬
;‬

int‬‭
‭ main‬
(){‬

vector‬
‭ <‬
‭ string‬
‭ >‬
‭ Vehicletype‬
‭ ={‬
‭ "‬
‭ Sedan‬
‭ "‭
‭,‬‬
"‬
‭ Suv‬
‭ "‬
‭ ,‭
‭"‬‬
Hatchback‬
‭ "‭
‭,‬‬
"‭
‭M‬iniSUV‬
"‭
‭,‬‬
"‬
‭ MicroSUV‬
‭ "‭
‭,‬‬
"‬
‭ Crossover‬
‭ "‬
‭ ,‬
‭ "‭
‭c‬onvertible‬
"‬
‭ ,‬

"‭
‭E‬lectriccar‬
"‭
‭,‬‬
"‬
‭ Hybridcar‬
‭ "‬
‭ ,‬
‭ "‭
‭c‬oupe‬
"‬
‭ };‬

vector‬
‭ <‬
‭ int‬
‭ >‬
‭ AverageMileage‬
‭ ={‬
‭ 15‬
‭ ,‭
‭1‬2‬
,‬
‭ 18‬
‭ ,‬
‭ 8‭
‭,‬‬
40‬
‭ ,‭
‭1‬20‬
,‭
‭ 2
‬5‬
,‭
‭1‬4‬
,‬
‭ 16‬
‭ ,‬
‭ 13‬
‭ };‬

map‬
‭ <‬
‭ string‬
‭ ,‬
‭ int‬
‭ >‬
‭ Rating‬
‭ ;‬

for‬
‭ (‬
‭ size_t‬‭
‭ i‬=‭
‭0‬‬
;‬
‭ i‭
‭<‬‬
Vehicletype‬
‭ .‬
‭ size‬
‭ ();‬
‭ i‭
‭+‬+){‬
Rating‬
‭ [‬
‭ Vehicletype‬
‭ [‭
‭i‬‬
]]=‬
‭ AverageMileage‬
‭ [‬
‭ i‬
‭ ];‬

}‬

for‬
‭ (‬
‭ auto‬‭
‭ it‬‭
:‬‭
Rating‬
){‬

cout‬
‭ <<‬
‭ it‬
‭ .‭
‭f‬irst‬
<<‬
‭ "‬‭
‭ "‭
<‬<‬
it‬
‭ .‬
‭ second‬
‭ <<‬
‭ "‭
‭\‬n‬
"‬
‭ ;‬

}‬

}‬

‭ .‬
4
#‭
‭ i
‬nclude‬<‭
‭b‬its/stdc++.h‬ >‬

using‬‭
‭ namespace‬‭ std‬ ;‬

int‬‭
‭ main‬(){‬

vector‬
‭ <‬
‭ string‬
‭ >‬
‭ coursetype‬
‭ ={‬
‭ "‭
‭B‬.tech‬ "‭
‭,‬‬
"‬
‭ M.tech‬
‭ "‬
‭ ,‬
‭ "‭
‭D‬iploma‬ "‬
‭ ,‬

"‭
‭C‬ertification‬ "‬
‭ ,‭
‭"‬‬
Online course‬
‭ "‬
‭ ,‬
‭ "‬
‭ Phd program‬
‭ "‭
‭,‬‬
"‬
‭ Bootcamp‬
‭ "‬
‭ ,‬

"‭
‭a‬ssociate degree‬ "‬
‭ ,‬
‭ "‭
‭i‬nternship‬"‬
‭ ,‬
‭ "‬
‭ workshop‬
‭ "‬
‭ };‬

vector‬
‭ <‬
‭ int‬
‭ >‬
‭ AverageDurationMonths‬
‭ ={‬
‭ 48‬
‭ ,‭
‭2‬4‬
,‬
‭ 12‬
‭ ,‬
‭ 6‬
‭ ,‭
‭3‬‬
,‬
‭ 60‬
‭ ,‬
‭ 4‬
‭ ,‭
‭2‬4‬,‭
‭2‬‬
,‬
‭ 1‬
‭ };‬

for‬
‭ (‬
‭ int‬‭
‭ i‭
=‬‬
0‬
‭ ;‬
‭ i‭
‭<‬‬
coursetype‬
‭ .‬
‭ size‬
‭ ();‬
‭ i‬
‭ ++){‬

cout‬
‭ <<‬
‭ coursetype‬
‭ [‬
‭ i‬
‭ ]<<‬
‭ "‬‭
‭ "‬<<‬
‭ AverageDurationMonths‬
‭ [‭
‭ i
‬‬]<<‬
‭ "‬
‭ \n‬
‭ "‬
‭ ;‬

}‬

}‬

‭ .‬
5
#‭
‭ i
‬nclude‬<‭
‭b‬its/stdc++.h‬ >‬

using‬‭
‭ namespace‬‭ std‬ ;‬

int‬‭
‭ main‬(){‬

vector‬
‭ <‬
‭ string‬
‭ >‬
‭ investmenttype‬
‭ ={‬
‭ "‬
‭ Stocks‬
‭ "‬
‭ ,‬
‭ "‬
‭ bonds‬
‭ "‬
‭ ,‬
‭ "‭
‭r‬ealestate‬
"‭
‭ ,
‬‬
"‭
‭M‬utualfunds‬ "‭
‭,‬‬
"‬
‭ gold‬
‭ "‭
‭,‬‬
"‬
‭ cryptocurrency‬
‭ "‭
‭,‬‬
"‬
‭ Fixeddeposit‬
‭ "‭
‭,‬‬
"‭
‭S‬avings account‬
"‬
‭ ,‬
‭ "‬
‭ ETF's‬
‭ "‬
‭ ,‬
‭ "‭
‭c‬ommodities‬
"‬
‭ };‬

vector‬
‭ <‬
‭ int‬
‭ >‬
‭ AverageDurationMonths‬
‭ ={‬
‭ 10‬
‭ ,‭
‭5‬‬
,‬
‭ 8‬
‭ ,‭
‭7‬‬
,‬
‭ 6‬
‭ ,‭
‭1‬5‬
,‭
‭4‬‬
,‬
‭ 2‬
‭ ,‭
‭9‬‬
,‬
‭ 6‭
‭}‬;‬

for‬
‭ (‬
‭ int‬‭
‭ i‭
=‬‬
0‬
‭ ;‬
‭ i‭
‭<‬‬
investmenttype‬
‭ .‬
‭ size‬
‭ ();‬
‭ i‭
‭+‬+){‬
cout‬
‭ <<‬
‭ investmenttype‬
‭ [‬
‭ i‬
‭ ]<<‬
‭ "‬‭
‭ "‬<<‬
‭ AverageDurationMonths‬
‭ [‬
‭ i‬
‭ ]<<‬
‭ "‬
‭ \n‬
‭ "‬
‭ ;‬

}‬

}‬

You might also like