Algorithm bubble sort

Assignment Help Data Structure & Algorithms
Reference no: EM13764008

Programming Project

This project focuses on an integration and demonstration of the knowledge and skills in this course with regard to the process of creating an algorithm to solve a problem and implementing that algorithm in the form of a working C language program. The project is due by Week 10, but there is lab time allocated for working on the project during weeks 6 through 9. The project is a significant portion (20%) of your course grade:

Purpose

This project is a great opportunity to express your unique problem solving skills as well as your use of structured logic. The project program requires, at a minimum, the use of decision structures, loops, properly named and typed variables, functions, arrays, and strings. The user interface is to have a menu of choices for input, and the output is to be well-formatted. The use of file I/O may be incorporated into the project, but is not required.

Project Logistics

You are required to write an original program for this project. Everyone is going to be developing an application menu program that has three defined application options to implement. Each student can choose, propose, and implement a fourth menu application option for extra credit. You may get ideas by reviewing the end-of-chapter programming projects in the textbook, or from your other courses or interests that you'd like to work with.

Project Requirements

An application menu program with the three application options described next is required. As mentioned above, a fourth application defined by you is optional. This application menu program builds on the Week 4 Lab Task 2 basic menu system program that you completed. The program prompts the user to choose the number of the application to run:

1 for the calculator application

2 for the sort a list of integers (smallest to largest) application

3 for the pluralize a noun application

4 for your chosen application (optional)

The user can run each application chosen as long as desired, and then gets to select another application to run. The user is instructed to enter 0 (zero) to exit the application menu program.

The calculator application is described in detail as programming project 10 on page 371 of your textbook. Instead of writing a function scan_data() that requires output parameters, I'd recommend reading in the operator and right operand from the calculator control function and validating both were read in, using another function to validate the operator is supported. For the function do_next_op(), it's fine to have three input parameters and returns the result. You'll also want to skip the rest of the data line before reading in any next operator and right operand. See Figure 5.14 on page 275 of your textbook for one way to do this.

The sort application uses an algorithm known as the bubble sort. This technique is described in programming project 13 on page 450 of your textbook. More details are provide next.

A bubble sort makes passes through a list, looking at pairs of adjacent elements to swap if not in the desired order. When a complete pass of the list is made where no swaps occur, the elements are in order. In the example that follows, elements swapped during a pass are bolded and underlined. You should limit the number of integers to sort at a time in your program.

The pluralize noun application is described in programming project 5 on pages 514 and 515 of your textbook. The rules and some nouns to try are included. The definition of a noun for this application is a word in all lower case letters with at least two letters. You should set, and notify users of, the maximum length of the nouns to pluralize in your program. Outside of warning the user that entering a noun not meeting the definition can produce unexpected results, you do not need to validate the nouns from the user. Not all words are correctly pluralized by this application and you are not required to fix this!

Reference no: EM13764008

Questions Cloud

How play macbeth relates to human nature : Shakespeare's Macbeth is often considered one of literature's greatest tragedies, because of Macbeth's tragic fall from grace, but because of how the play relates to human nature and the conflicts inherent in human nature.
Why is an enterprise security an importance piece : Why is an Enterprise Security an importance piece to the success of a business
What did you learn about the innocence project : What did you learn about the Innocence Project and eyewitness identification? What surprised you the most
Research paper about social problems : Prepare a five page research paper about social problems where the free markets are not allowed to function, which includes the market for a particular illegal good and service, a regulated market, etc.
Algorithm bubble sort : This project is a great opportunity to express your unique problem solving skills as well as your use of structured logic.
Write a review of case study abc inc and carl robins : Write a review of Case Study ABC, Inc. Case-Study Analysis and Carl Robins Case Study Analysis Papers from members of your Learning Team. Use the Case Study Analysis Peer Review Form as a guide for your reviews.
Develop a proposal for implementing it security management : Utilizing your comprehensive Security plan outline, develop a proposal for implementing IT Security Management.
Analyze these facts using ethical concepts or concerns : When Jonas had been questioned by the police at the station, he claimed he knew nothing of the incident, and the police have no evidence tying Jonas to the disappearance or murder. Analyze these facts using ethical concepts or concerns
Explain reasons for human population increase : Define population dynamics and discuss factors which affect population's dynamics.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  For what values of d is the tree t

For what values of d is the tree T of the previous exercise an order -d B-tree? HINT: The definition of an order- d  deals with the minimum and maximum number of children an internal node can have.

  Design the logic for a program

Draw the hierarchy chart and design the logic for a program that calculates the projected cost of an automobile trip. Assume that the user's car travels 20 miles per gallon of gas.

  Algorithm to take input m constraints over n variables

For instance, the constraints x1 = x2, x2 = x3, x3 = x4, and x1 6= x4 cannot be satis fied. Give an efficient algorithm that takes as input m constraints over n variables and decides whether the constraints can be satis fied.

  Find method searches the haystack array

Write a class, ArraySearch that has two methods - The find method searches the haystack array to see if the elements within are the same, which is determined by the equals method, as the needle.

  Show result of inserting keys using linear probing

Show the result of inserting these keys using linear probing, using quadratic probing with c1 = 1 and c2 = 3, and using double hashing with h2(k) = 1 + (k mod (m ¡ 1)).

  Write down the algorithm to insert an item

Write down the sample code to create a Linked List and allocate storage space for a node Write down the algorithm to insert an item At the beginning of a linked list

  Write algorithm using pseudo code consensus algorithm

Write an algorithm, using pseudo code, "Consensus algorithm": A group of ten people need to decide which one flavor of ice cream they will all order, out of three options.

  Design algorithm based on bfs that colors a graph

Design an algorithm based on BFS that either colors a graph with 2 colors or determines that two colors are not sufficient.

  Create algorithm which takes as inputs matrices

Create the algorithm which takes as inputs, matrices C, D, and vertex indices i and j, and returns minimum-cost path from vertex i to vertex j.

  What is the minimum number of attendants

A nursing home employs attendants who are needed around the clock. Each attendant is paid the same, regardless of when his or her shift begins. Each shift is 8 consecutive hours.

  Create algorithm to read arbitrary number of data record

Create the algorithm to read arbitrary number of data records, each containing name, age, and code. Code of 1 will indicate female, a code of 2 will indicate male.

  Explain pros and cons of algorithm

You can start by taking 3-4 schemes for example and then show each step of the GA based algorithm numerically. Explain each step (selection, cross-over, mutation) in detail. You can show in any way as long as each step is shown and explained numer..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd