Skip to content

Commit ded7063

Browse files
committed
Merge branch 'master' of https://github.com/bhoffman0/CSAwesome
2 parents 48dca58 + fde8537 commit ded7063

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

_sources/Unit3-If-Statements/topic-3-5-compound-ifs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,11 @@ AP Practice
600600

601601
- Third cannot be printed out unless First is printed out first.
602602

603-
- FirstSecond
603+
- First Second
604604

605605
+ Good tracing!
606606

607-
- FirstThird
607+
- First Third
608608

609609
- Take another look at the second condition.
610610

_sources/Unit6-Arrays/topic-6-2-traversing-arrays.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,13 +1062,17 @@ Be careful not to jump out of loop too early when you are looking for a value in
10621062

10631063
<a href= "https://replit.com/@BerylHoffman/SpellChecker1" target="_blank">replit</a>
10641064

1065+
.. |JuiceMind| raw:: html
1066+
1067+
<a href= "https://play.juicemind.com/dashboard/teams/Mk2wWMTqPkekcxTDWqRn/item/97829972-9107-46cd-8258-61b6cc781241#f8c29bd7-3d6b-4ea8-8cf5-0a6ec6d6b918" target="_blank">JuiceMind</a>
1068+
10651069
.. |input files| raw:: html
10661070

10671071
<a href="https://runestone.academy/ns/books/published/csawesome/Unit7-ArrayList/topic-input-files.html" target="_blank">input files</a>
10681072

10691073
In this challenge, you will use an array of English words from a dictionary file to see if a given word is spelled correctly. We encourage you to work in pairs for this challenge. Make sure you have done the last coding exercise above which will help you with this challenge.
10701074

1071-
This challenge includes a dictionary file of 10,000 English words which is read into the array dictionary for you. You could use this |replit| code instead that has an even bigger dictionary of English words and lets you do input with your spell checker. If you use repl, copy in the link for your repl in the Active Code window below to turn it in. If you are interested in how to read in files using Java, there is an optional |input files| lesson at the end of Unit 7.
1075+
This challenge includes a dictionary file of 10,000 English words which is read into the array dictionary for you. You could use this |JuiceMind| or |replit| code instead that has an even bigger dictionary of English words and lets you do input with your spell checker (click on the folder to see all the files). If you are interested in how to read in files using Java, there is an optional |input files| lesson at the end of Unit 7.
10721076

10731077
1. Write a ``print10`` method that prints out the first 10 words of the dictionary array. Do not print out the whole array of 10,000 words!
10741078
2. Write a ``spellcheck`` method that takes a word as a parameter and returns true if it is in the dictionary array. It should return false if it is not found (When can you tell that you have not found a word in the dictionary?). Test your code below by changing the word sent to the spellcheck() method in main. This algorithm is called a **linear search** where we step through the array one element at a time (here the dictionary one word at a time) looking for a certain element.

_sources/Unit9-Inheritance/topic-9-5-hierarchies.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,16 +343,20 @@ objects. Notice that the loop works with a variable of type ``Pet`` because a
343343
|Groupwork| Programming Challenge : Shopping Cart
344344
--------------------------------------------------
345345

346-
.. |replit.com link| raw:: html
346+
.. |replit| raw:: html
347347

348-
<a href="https://firewalledreplit.com/@BerylHoffman/Shopping-Cart" target="_blank" style="text-decoration:underline">replit.com link</a>
348+
<a href="https://firewalledreplit.com/@BerylHoffman/Shopping-Cart" target="_blank" style="text-decoration:underline">replit</a>
349+
350+
.. |JuiceMind| raw:: html
351+
352+
<a href="https://play.juicemind.com/dashboard/teams/Mk2wWMTqPkekcxTDWqRn/item/e0f2d26d-0359-4f8d-9353-9b33ebdae6a8#f38b57f6-4254-4e0a-a92f-258fef212ef1" target="_blank" style="text-decoration:underline">JuiceMind</a>
349353

350354
.. image:: Figures/shoppingcart.png
351355
:width: 100
352356
:align: left
353357
:alt: Shopping
354358

355-
The following code contains a class called ShoppingCart that simulates a grocery store or an online store's shopping cart. It has an ArrayList called order that you can use to add Items to the shopping cart. The Item class keeps track of the name and the price of each Item. If you run the code below, you will see that it adds 2 items to the cart and then prints out the total order. It may be easier to follow and change the code in this |replit.com link|. We encourage you to work in pairs.
359+
The following code contains a class called ShoppingCart that simulates a grocery store or an online store's shopping cart. It has an ArrayList called order that you can use to add Items to the shopping cart. The Item class keeps track of the name and the price of each Item. If you run the code below, you will see that it adds 2 items to the cart and then prints out the total order. It may be easier to follow and change the code in |JuiceMind| or |replit| where the code is in separate class files (click on the folder to see all the files). We encourage you to work in pairs.
356360

357361
In this challenge, you will add a new class called ``DiscountedItem`` that extends the ``Item`` class. The ``ArrayList`` of ``Item`` will still work since it can hold the subclasses of ``Item`` too! The ``ShoppingCart`` ``printOrder`` method will work with ``Item`` and ``DiscountedItem`` but note that it has an ``if`` statement that treats ``DiscountedItem`` differently.
358362

0 commit comments

Comments
 (0)