Lovelace Cupcakes – Insertion Sort
Cupcakes coded with love
The first computer programmer in the world was a women, Ada Lovelace. (Links to an external site.)
What the assignment is about
Ms. Lovelaces great great-great-grandchild is Lilly is an amazing computer scientist. Lilly Lovelace has decided to create a cupcake business to honor Ada. The cupcakes have sweet names mixed with technical terms. The business has 120 distinct designs of cupcakes with 2 types of frosting. Cupcakes range from Macaroon Sesame with Chocolate Frosting to Jelly Plum with Whipped Cream Frosting. Lovelace Cupcakes can serve an impressive 480 types of cupcakes to its customers and has over 800 franchises in more than 70 cities around the world.
The Lovelace business has grown into an empire worth billions of dollars and they now need to sort their menu and need the company needs help.
They have hired you to complete this task.
Sincerely,
Lilly Lovelace, CEO Lovelace Cupcakes – Cupcakes coded with love.
What to do
Implement insertion sort (Links to an external site.) for Lilly Lovelace that prints all the cupcakes alphabetically list.
How to do it
Task 1
Review and study the Canvas modules on Arrays and Sorting as needed. Insertion Sort is a well-known sorting algorithm with O(n^2) performance.
Task 2
Create a new GitHub repository by using GitHub desktop
Perform a GitHub commit and publish to publish your repository on GitHub.com
Task 3
Create a Maven project in your GitHub repository folder.
Run your new Maven application (App.java) and make sure it works (it should print hello world).
If you can’t recall how to create a Maven project properly, please review the previous “Hello World with Maven” assignment which contains detailed instructions on Maven and example videos for students.
Perform a GitHub commit and include a short concise commit message to help build up your Git history through development.
Perform a GitHub push to save your work to GitHub.com
Repeat the edit code, git commit, git push process until you have completed this task.
- Task 4
Download the lovelace-cupcake-example-code.zip Download lovelace-cupcake-example-code.zipthat includes BubbleSort.java (or MergeSort.java) example code and put it into your project. This .zip file also includes the cupcake_3906.json data file.
- Edit the code to get the sorting algorithm to run on your computer.
The example code is example code provided to give students a head start. Students do not have to use it. Students can certainly write their own solution from scratch if they wish to.
If students have trouble getting the example code to work, I highly recommend students come to office hours and/or talk with other students.
Edit your code by making small incremental changes.
For each small change, perform a GitHub commit and include a short concise commit message.
- Perform a GitHub push to save your work to GitHub.com
Repeat the change/edit code, git commit, git push process until you have completed this task.
- Task 5
Copy BubleSort.java and make InsertionSort.java
- Run InsertionSort and get it to list all the cupcakes sorted.
For each small change, perform a GitHub commit and include a short concise commit message.
- Perform a GitHub push to save your work to GitHub.com
Repeat the change/edit code, git commit, git push process until you have completed this task.
- Task 6
Read and watch videos on insertion sort to learn its fundamentals. There are hundreds of videos on the internet explaining insertion sort. Below is a high-quality and excellent video and demo on insertion sort that Harvard University produced.
- Task 7
Copy the insertion sort code from Geeks for Geeks written in Java (Links to an external site.) for insertion sort algorithm and get it to run