Answered step by step
Verified Expert Solution
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 : Implement the selection sort algorithm:
Code the selection sort logic using bidtitle as the sort field.
Invoke the selectionSort method from the main method including collecting and reporting timing results.
Task : Implement the quicksort algorithm:
Code the quicksort logic using bidtitle 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 ~DownloadseBidMonthlySales.csv
VectorSorting.exe DownloadseBidMonthlySales.csv
Loading bids from CSV and performing a selection sort:
Example Input Choice: Choice:
Display Menu:
Load Bids
Display All Bids
Selection Sort All Bids
QuickSort All Bids
Exit
Enter choice: Menu:
Load Bids
Display All Bids
Selection Sort All Bids
QuickSort All Bids
Exit
Enter choice:
Output Loading CSV file
eBidMonthlySales.csv
bids read
time: clock ticks
time: seconds bids sorted
time: clock ticks
time: seconds
Loading bids from CSV and performing a quicksort:
Example Input Choice: Choice:
Display Menu:
Load Bids
Display All Bids
Selection Sort All Bids
QuickSort All Bids
Exit
Enter choice: Menu:
Load Bids
Display All Bids
Selection Sort All Bids
QuickSort All Bids
Exit
Enter choice:
Output Loading CSV file
eBidMonthlySales.csv
bids read
time: clock ticks
time: seconds bids sorted
time: clock ticks
time: seconds
Notice the huge time difference in sorting records: seconds compared to just 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. Wellannotated 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 itemcost underscored
Organized structure and clear design that separates components with different responsibilities or groupingrelated code into blocks.
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