Question
Create a Microsoft Visual Studio C++ WIN32 project. Create it as a Console Application, and an Empty Project. Add a single .cpp file only, and
1.Create an STL vector object, and store the first 30 Fibonacci numbers in the vector. Display the vector.
2.Create an STL list object and an iterator to go with it. Add 20 random numbers to the list. Display the list using the iterator. Sort the list with the STL sort() method (mylist.sort() for a list object called mylist). Display the list from smallest to largest, and then from largest to smallest using iterators.
3.Write a struct called orderedPair that includes two doubles, x and y. Create an STL list of orderedPair items. Populate the list with 10 pairs of random doubles, where each x and y is in the range 0.0 to 99.9 and has 1 decimal point of accuracy. Using an iterator, display the list in the format (x1, y1),(x2, y2), (x3, y3),.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started