Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You must perform the following steps to complete this activity: Setup: Begin by creating a new C + + project with the project type Hello

You must perform the following steps to complete this activity:
Setup: Begin by creating a new C++ project with the project type Hello World C++ Project. For help setting up your project in Visual Studio C++, refer to the Apporto Visual Studio Setup Instructions and Tips in the Module One Resources section. Name the project VectorSorting.
Task 1: Implement the selection sort algorithm:
Code the selection sort logic using bid.title as the sort field.
Invoke the selectionSort() method from the main() method including collecting and reporting timing results.
Task 2: Implement the quicksort algorithm:
Code the quicksort logic using bid.title as the sort field.
Invoke the quickSort() method from the main() method including collecting and reporting timing results.
Here is sample output from running the completed program:
>./VectorSorting ~/Downloads/eBid_Monthly_Sales.csv
> VectorSorting.exe Downloads\eBid_Monthly_Sales.csv
Loading bids from CSV and performing a selection sort:
Example Input Choice: 1 Choice: 3
Display Menu:
1. Load Bids
2. Display All Bids
3. Selection Sort All Bids
4. QuickSort All Bids
9. Exit
Enter choice: 1 Menu:
1. Load Bids
2. Display All Bids
3. Selection Sort All Bids
4. QuickSort All Bids
9. Exit
Enter choice: 3
Output Loading CSV file
eBid_Monthly_Sales.csv
12023 bids read
time: 12023 clock ticks
time: 0.173945 seconds 12023 bids sorted
time: 10623604 clock ticks
time: 10.6236 seconds
Loading bids from CSV and performing a quicksort:
Example Input Choice: 1 Choice: 4
Display Menu:
1. Load Bids
2. Display All Bids
3. Selection Sort All Bids
4. QuickSort All Bids
9. Exit
Enter choice: 1 Menu:
1. Load Bids
2. Display All Bids
3. Selection Sort All Bids
4. QuickSort All Bids
9. Exit
Enter choice: 4
Output Loading CSV file
eBid_Monthly_Sales.csv
12023 bids read
time: 174985 clock ticks
time: 0.174985 seconds 12023 bids sorted
time: 47964 clock ticks
time: 0.047964 seconds
Notice the huge time difference in sorting 12,000 records: 10.6 seconds compared to just 0.04 seconds!
Specifically, you must address the following rubric criteria:
Code Reflection: Describe the purpose of code, techniques implemented to solve problems, challenges encountered, and approaches to overcome the challenges.
Pseudocode or Flowchart: Provide a pseudocode or flowchart description of the code that is clear and understandable and captures accurate logic to translate to the programming language.
Specifications and Correctness: Source code must meet its specifications and behave as desired. Correct code produces the correct output as defined by the data and problem. However, you should also produce fully functioning code with no errors that aligns with as many of the specifications as possible. You should write your code in a way that the submitted file executes, even if it does not produce the correct output. You will be given credit for partially correct output that can be viewed and seen to be partially correct.
Annotation and Documentation: All code should also be well commented. Commenting is a practiced art that requires striking a balance between commenting everything, which adds unneeded noise to the code, and commenting nothing. Well-annotated code requires you to perform the following actions:
Explain the purpose of lines or sections of your code, detailing the approach and method you took to achieve a specific task in the code.
Document any section of code that is producing errors or incorrect results.
Modular and Reusable: Programmers should develop code that is modular and reusable. Code is more flexible and maintainable if it contains functionality and responsibility in distinct methods. Your code should adhere to the single responsibility principle. Classes and methods should do only one job. If you can use a different method without changing other parts of your code, you have succeeded in creating modular methods.
Readability: Code needs to be readable to a knowledgeable programmer. In this course, readable code requires the following characteristics:
Consistent, appropriate whitespace (blank lines, spaces) and indentation to separate distinct parts of the code and operations
Explicit, consistent variable names, which should clearly indicate the data they hold and be formatted consistently, for example, numOrders (camelCase) or item_cost (underscored)
Organized structure and clear design that separates components with different responsibilities or grouping-related code into blocks.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

How often do you meet with your graduate students?

Answered: 1 week ago