Difference between revisions of "Cash Receipt"

From CompSciWiki
Jump to: navigation, search
(edited up to part one, and a few of the headers)
m (fixed links)
 
(11 intermediate revisions by 2 users not shown)
Line 66: Line 66:
  
 
|Solution=
 
|Solution=
Before you start writing code, you need to think about the problem in greater detail. Then you need to declare and initialize the variables you know you need. Finally you can program the problem in two parts.
+
Before starting to write code, we will think about the problem in greater detail. Then we will declare and initialize the needed variables. Finally, we will program the problem in two parts: handling input, and obtaining output.
 
+
  
 
==Break the Problem Down==
 
==Break the Problem Down==
While this problem is lengthier than others, the first rule of Computer Science is to break the problem into pieces. Ultimately we want the whole program done, but we need to break it into parts we can work on bit by bit. Start by reading the problem and figuring out what to do step by step.  
+
This problem is lengthier than others. Luckily in Computer Science, breaking the problem into pieces is often the best strategy. Ultimately the goal is to have the whole program done, and breaking the problem into parts allows it to be manageable. Start by reading the problem and planning which parts to do first.  
  
==Declare your Variables==
+
==Keep the Code Organized==
Based on the problem description, we know we will need to use constants and use [http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JOptionPane.html JOptionPane]. [http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JOptionPane.html JOptionPane] requires that we store text in strings, so we must use [http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html strings]. We're also dealing with [http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Integer.html integers] and decimal value numbers which we will store as ([http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Double.html doubles]).
+
The [http://courses.cs.umanitoba.ca/index.asp?sec=3394&too=30&eve=1&ppa=5178 COMP 1010 Coding Standards] give the guidelines required to keep our code organized. Make sure the code is properly indented, all variables are properly named (as in: ''double change'', as opposed to: ''double a'') and initialized. Integer variables can be initialized to zero, if no other value is more appropriate. Strings can be initialized to be empty, that is two double quotes: "". Also, include comments in your code.
 
+
==Keep your Code Organized==
+
The [http://courses.cs.umanitoba.ca/index.asp?sec=3394&too=30&eve=1&ppa=5178 COMP 1010 Coding Standards] give the foundation required to keep your code organized for this case study. You need to make sure your code is properly indented, variable names are properly named (as in: ''double change'', as opposed to: ''double a'') and all variables are initialized to zero or empty string constants which are "". Also, comments should always be included in your code.
+
  
 
==Get it Done==
 
==Get it Done==
Some programs will take longer than one sitting to complete. You must realize and accept that some programs can be done quickly, and other programs can take a very long time. No matter what you code, you will always have to deal with bugs. Start on your programs early enough and don't procrastinate. Leaving a program to the last minute — especially further on in the Computer Science degree — will cost you mentally and hurt your marks.
+
Some programs will take longer than one sitting to complete. Realize and accept that some programs can be done quickly, and others take more time. An inevitable part of programming is dealing with bugs. Start on programs early enough and do not procrastinate. Leaving a program to the last minute — especially further on in the Computer Science degree — will cost you.
 +
 
 +
=Part One: Declare Variables and Constants=
 +
 
 +
Based on the problem description, we know we will need to use constants, variables, and [[Input_using_JOptionPane| JOptionPane]]. JOptionPane requires that we store text in strings, so we must use [[Strings| strings]]. We're also dealing with [http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Integer.html integers] and decimal value numbers. We will store the decimal value numbers as ([http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Double.html doubles]).
  
==Part Zero: Declare Variables==
 
 
You will need to have two string variables. You also need three integer variables, six double variables and four double constants.
 
You will need to have two string variables. You also need three integer variables, six double variables and four double constants.
  
Line 89: Line 88:
  
 
'''The integer variables are to store the quantity of items bought. You will need one integer variable for each of the following :'''
 
'''The integer variables are to store the quantity of items bought. You will need one integer variable for each of the following :'''
* Brushes<br>
+
* Brushes
* Paint sets<br>
+
* Paint sets
* Primer<br>
+
* Primer
  
'''The double variables are for storing:<br>'''
+
'''The double variables are for storing:'''
 
* The tax
 
* The tax
 
* The subtotal of the bill
 
* The subtotal of the bill
Line 101: Line 100:
 
* The total change given to the nearest nickel
 
* The total change given to the nearest nickel
  
'''The double constant variables are for storing:<br>'''
+
'''The double constants are for storing:'''
 
* The tax rate
 
* The tax rate
 
* The cost of the brushes
 
* The cost of the brushes
Line 107: Line 106:
 
* The cost of the primer
 
* The cost of the primer
  
==Part One: Continue with Some Code==
+
To declare a [[named constant]] add the keyword '''final''' before the type. For example, the following line declares a constant double called cost:
Now that you've completed the first task of setting up variables (and remembering to initialize them all to either 0 or empty string constants which are ""), the next task you want to do is print out "Welcome to ArtSupply". You can do this using System.out.println(). Then you want to prompt the user to enter their name. To do this, you need to use [http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JOptionPane.html JOptionPane]. Then you want to store the text entered in a string. This can be simply done roughly like this (you will need to fill in the parameters to the showInputDialog method):
+
final double cost;
  
StringVariable = JOptionPane.showInputDialog();
+
=Part Two: Handling Input=
 +
Now that we have completed the first task of setting up variables, we need to program a sequence of prompts, calculations and some printing to the terminal.
 +
The following pseudocode gives you a good overview of what needs to be done. Pseudocode is a great tool to start writing a program without technical details slowing us down.  
  
Once you have the text stored, you want to print out the string value and move the cursor to a new line. You can do this by using the System.out.println("<text>") function. Continue on by prompting the user to enter in 3 numbers using [http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JOptionPane.html JOptionPane]. Each time the user enters a number you want to convert the entered value to an integer and then print the numbers. The following code illustrates how to convert the entered value to an integer:
+
//Pseudocode:
 +
Print out "Welcome to ArtSupply"
 +
Prompt for cashier's name.
 +
Prompt for number of brush sets.
 +
Prompt for number of primers.
 +
 +
Calculate product total.
 +
Print product total.
 +
 +
Calculate tax.
 +
Print tax.
 +
 +
Calculate total.
 +
Print total.
 +
 +
Prompt for money received.
 +
Print the money received.
 +
 +
Calculate change due.
 +
Print the change due.
 +
 +
Calculate change rounded up to the nearest nickel.
 +
Print change rounded up to the nearest nickel.
 +
Print cashier's name.
  
IntegerVariable = Integer.parseInt(StringVariable);
 
  
To print the numbers, you use System.out.println(<variable name>)
+
To prompt for input, use the JOptionPane class. To understand how to use the JOptionPane for input, read [Input_using_JOptionPane Input Using JOptionPane]. In order to get input, use JOptionPane's showInputDialog method. This method returns the text the user typed into the input dialog box as a string. Store that text in a String variable. This can be simply done roughly like this:
  
We can also assume that the user is entering a number and therefore we do not need to do any error checking.
+
someStringVariable = JOptionPane.showInputDialog("What is your input?");
  
'''Advanced Tricks and Tips:''' to error check this code, you can take the input text and store it into a string. Then you can use a piece of code called a [http://www.exampledepot.com/egs/Java%20Language/TryCatch.html try catch block] along with a [http://download.oracle.com/javase/1.5.0/docs/api/java/lang/NumberFormatException.html NumberFormatException].
+
Once we have the input text stored, we want to print out the string value and move the cursor to a new line. We can do this by using the System.out.println("<text>") function. Continue on by prompting the user to enter in 3 numbers using [http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JOptionPane.html JOptionPane]. Each time the user enters a number we want to convert the entered value to an integer and print the number. The following code illustrates how to convert the entered value to an integer:
  
After the inputs are entered and properly stored, you need to do some math. Proceed by calculating the subtotal, tax and the total amount using simple math equations. After the values are calculated, print out the subtotal, the tax, the total amount. Make sure the output is in the same order as the output shown in the problem description.
+
someIntegerVariable = Integer.parseInt(StringVariable);
 +
 
 +
This method parseInt works well so long as the user enters a number and not something else. This means that the user could crash the program by not entering a number when they are supposed to. The correct way to fix this potential problem is to do error checking. However, for the sake of simplicity, we will assume that the user always enters a number.
 +
 
 +
After the inputs are entered and properly stored, we need to do some math. Proceed by calculating the subtotal, tax and the total amount using simple math equations. After the values are calculated, print the subtotal, the tax, and the total amount. Make sure the output is in the same order as the output shown in the problem description.
  
 
'''You are now about half way done this program!'''
 
'''You are now about half way done this program!'''
  
==Part Two==
+
=Part Three: Output=
Now the cashier is waiting for the customer to pay. Assuming the customer is not a thief, they would hand the cashier an amount greater than or equal to the total amount owing. Being the programmer that you are, you know you need to code your program to allow for this transaction to occur. Again you do not need to error check to make sure the customer give the cashier a proper amount (meaning that the customer did not shortchange the cashier).
+
Now the cashier is waiting for the customer to pay. Assuming the customer is not a thief, they would hand the cashier an amount greater than or equal to the total amount owing. This means we do not need to error-check to make sure the customer gives the cashier a proper amount (meaning that the customer did not shortchange the cashier).
  
'''Note for extended development:''' You can check to make sure that the amount of change you give to the cashier is greater than the total owing by using an [http://download.oracle.com/javase/tutorial/java/nutsandbolts/if.html if statement].
+
Use [http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JOptionPane.html JOptionPane] to prompt for an amount given, and then convert the string returned to a double (again assume they enter a proper number, so that no error checking is needed). The following code shows how to convert a string to a double:
  
Again use [http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JOptionPane.html JOptionPane] to prompt for an amount given, and then convert it to a double (no error checking again is needed, however once again you can use a [http://www.exampledepot.com/egs/Java%20Language/TryCatch.html try catch block] for further development). To convert to a double, you can use:
+
DoubleVariable = Double.parseDouble(StringVariable);
<pre>
+
DoubleVariable = Double.parseDouble(StringVariable);
+
</pre>
+
  
Print out the money received, then subtract the total owed from the amount of change given. Then calculate any change the cashier needs to give back to the customer and print it out (even if it is $0.00). Finally round the amount of change given back to the nearest nickel and print that value.
 
  
Your code is now complete!
+
Print the amount given. Calculate any change the cashier needs to give to the customer and print it (even if it is $0.00). Round the amount of change to the nearest nickel and print that value.
  
'''Final note for extended knowledge:''' If you get a value in your output that is longer than expected, ie: for calculating change, instead of $0.07 being printed, you get a number like: 0.069999999... there is no bug in your code causing this. You can fix it by multiplying your number by 100, rounding it, and then dividing it by 100. If you want more information on why extra numbers appear, please take [https://aurora.umanitoba.ca/banprod/bwckctlg.p_disp_course_detail?cat_term_in=201090&subj_code_in=COMP&crse_numb_in=2190 COMP 2190]
+
'''Your code is now complete!'''
  
==Post-programming Instructions==
+
=Post-programming Instructions=
Now you may want to close your program, submit it and be happy that you're done! Unfortunately, reality doesn't work that way. You are only about half done with your program. The other half is coders need to make sure their program works, and is done properly. Below are a few steps you need to take when you feel you have finished your program.
+
Now you may want to close your program, submit it and be happy that you're done! Unfortunately, reality doesn't work that way. You are only about half done with your program. Now you need to make sure your program works, and is up to standards. Below are a few steps you need to take when you feel you have finished your program.
  
 
==Look it over==
 
==Look it over==
Line 152: Line 175:
  
 
==Optimize the Code by Removing Unnecessary Variables==
 
==Optimize the Code by Removing Unnecessary Variables==
At the top of [[Your First Java Program#The Main Method|the main method]], you should have a number of variables. If you have any extra than what the above solution suggests, see if you can get rid of any extras you don't need.
+
At the top of [[Your First Java Program#The Main Method|the main method]], you should have a number of variables. If you have any more than what the above solution suggests, see if you can get rid of any extras you don't need.
  
 
==Try to Break your Program==
 
==Try to Break your Program==
In this question, breaking your code would be easy to do unless you implement the error checking procedures. You could easily break your code by entering in a letter instead of a number and trying to convert that string into an integer or double. However, if you do implement the error checking procedures in this program, and for your future programs, the best way to make sure you have complete and fantastic code is if you cannot make your program explode no matter what you do. The number one reason individuals are penalized for their code is because a random situation arises, even though it's highly unlikely to happen (but they do), and the programmer has not added the necessary code to handle the exception.
+
In this question, breaking your code would be easy to do unless you implement the error-checking procedures. You could easily break your code by entering in a letter instead of a number and trying to convert that string into an integer or double. However, if you do implement the error checking procedures in this program, and for your future programs, the best way to make sure you have complete and fantastic code is if you cannot make your program explode no matter what you do. The number one reason individuals are penalized for their code is because a random situation arises, even though it's highly unlikely to happen (but they do), and the programmer has not added the necessary code to handle the exception.
  
 
==The Feeling of Hopelessness==
 
==The Feeling of Hopelessness==
Line 161: Line 184:
  
 
==Parting Statements==
 
==Parting Statements==
Remember that this is not the only "correct" way to do this program. There can be many different ways to accomplish this program and it can be further developed to handle error checking from any aspect. Remember to code efficiently, accurately, and properly. This means: no more excess code than needed, know what you're trying to code and break it down as needed to accomplish parts of it at a time rather than the whole thing in one sitting, and comment and indent your code appropriately. Always remember to test your program as much as you possibly can, and practice, practice, practice! The more you code, the better you will become at it.
+
Remember that this is not the only "correct" way to do this program. There can be many different ways to accomplish this program and it can be further developed to handle error-checking from any aspect. Remember to code efficiently, accurately, and properly. This means: no more excess code than needed, know what you're trying to code and break it down as needed to accomplish parts of it at a time rather than the whole thing in one sitting, and comment and indent your code appropriately. Always remember to test your program as much as you possibly can, and practice, practice, practice! The more you code, the better you will become at it.
  
 
|SolutionCode=
 
|SolutionCode=
 
import javax.swing.*;
 
import javax.swing.*;
  
/**....................................................................A1Q3<br>
+
/**....................................................................A1Q3
  * Print ticket invoice <br>
+
  * Print ticket invoice  
  * 74.101 SECTION L08/L09 <br>
+
  * 74.101 SECTION L08/L09  
  * INSTRUCTOR  Terry Andres/Christina Penner <br>
+
  * INSTRUCTOR  Terry Andres/Christina Penner
 
  * ASSIGNMENT  #1  QUESTION #2
 
  * ASSIGNMENT  #1  QUESTION #2
 
  * @author C. Penner/T. Andres, 999999
 
  * @author C. Penner/T. Andres, 999999
Line 176: Line 199:
 
public class A1_Receipt {
 
public class A1_Receipt {
  
   /**..................................................................main<br>
+
   /**..................................................................main
 
   * PURPOSE: main reads items for a store, prints invoice, and calculates change
 
   * PURPOSE: main reads items for a store, prints invoice, and calculates change
 
   * @param args is a list of command line arguments
 
   * @param args is a list of command line arguments
Line 268: Line 291:
 
   }
 
   }
 
}
 
}
 +
 +
 +
 +
|SideSectionTitle=Cash
 +
|SideSection=
 +
[[Image:Money_casestudy.jpg|center]]<BR>
 +
 +
  
 
}}
 
}}

Latest revision as of 15:19, 7 April 2011

Back to the Case Studies homepage

Problem

You are a self-employed junior programmer. You've just started your own business and today, you've gotten your first job from a manager at a small arts and crafts store. The manager wants you to write a complete Java program that can be used by any cashier within her company to generate customer receipts for her convenience store which currently sells only three items.


First: The three items are brush sets, paint sets and primer. Since the prices of these materials will not change for a long time, you should use constants to store the cost of each of the three items and the tax rate.

Then, since the program is going to be used by multiple cashiers, use JOptionPane to prompt the user to enter:

  1. The current cashier’s name
  2. The quantity of each item.


The program will calculate and output:

  1. The subtotal
  2. Tax
  3. Total.


As each item is entered, the program prints out the input given on a new line each time. After the quantity of the last item is entered, the program calculates a subtotal and prints it, then it prints out the tax value, and then calculates the subtotal plus tax as a final total and prints that value.

Now the program waits for the cashier to enter in a payment given amount. So now:

  1. Prompt the cashier to enter a payment amount,
  2. Calculate and print any change needed to be given back to the customer (if they overpaid) and
  3. Round the change given to the nearest nickel and print that value.
  4. Finally print out "Change given by: <cashier's name>"


Some details:

Constants: Store the cost of each item as a constant. Also, store the tax rate (7%) as a constant.

Input: Prompt the user to enter his/her name. Then use JOptionPane to input the quantity of each item. Finally use JOptionPane to input the amount of change given.

Calculate and Output:

  1. The subtotal (the cost of the items without tax)
  2. Tax
  3. Total (of product plus taxes).


Also output the name of your store at the top of the receipt. When finding the change, use Math.ceil to round up so the customer gets the full change, and possibly more. For example, if the change due is 4.637, round to 4.64 using pennies and 4.65 using nickels.

Use Math.round() to round all output to two decimal spots.

If your input values were 2 brush sets ($8 each), 3 paint sets ($40 each), and 4 cans of primer ($18.75 each), and your cashier's name is Joni, your output should look like:


Welcome to ArtSupply.

Cashier: Joni
2 brush sets at $ 8.0
3 paint sets at $ 40.0
4 primer at $ 18.75
Product Total: $211.0
Tax: $ 14.77
Total = $ 225.77
Money received: $ 250.0
Change due: $ 24.23
Change rounded up to nearest nickel: $ 24.25
Change given by: Joni


The store manager wants you to use proper programming practices which happen to be exactly the same as the standards in Comp 1010.

 

Cash

Money casestudy.jpg

Solution

Before starting to write code, we will think about the problem in greater detail. Then we will declare and initialize the needed variables. Finally, we will program the problem in two parts: handling input, and obtaining output.

Break the Problem Down

This problem is lengthier than others. Luckily in Computer Science, breaking the problem into pieces is often the best strategy. Ultimately the goal is to have the whole program done, and breaking the problem into parts allows it to be manageable. Start by reading the problem and planning which parts to do first.

Keep the Code Organized

The COMP 1010 Coding Standards give the guidelines required to keep our code organized. Make sure the code is properly indented, all variables are properly named (as in: double change, as opposed to: double a) and initialized. Integer variables can be initialized to zero, if no other value is more appropriate. Strings can be initialized to be empty, that is two double quotes: "". Also, include comments in your code.

Get it Done

Some programs will take longer than one sitting to complete. Realize and accept that some programs can be done quickly, and others take more time. An inevitable part of programming is dealing with bugs. Start on programs early enough and do not procrastinate. Leaving a program to the last minute — especially further on in the Computer Science degree — will cost you.

Part One: Declare Variables and Constants

Based on the problem description, we know we will need to use constants, variables, and JOptionPane. JOptionPane requires that we store text in strings, so we must use strings. We're also dealing with integers and decimal value numbers. We will store the decimal value numbers as (doubles).

You will need to have two string variables. You also need three integer variables, six double variables and four double constants.

The string variables are for:

  • temporarily storing input strings for quantity
  • storing the cashier's name

The integer variables are to store the quantity of items bought. You will need one integer variable for each of the following :

  • Brushes
  • Paint sets
  • Primer

The double variables are for storing:

  • The tax
  • The subtotal of the bill
  • The total of the bill (this includes tax)
  • The total payment given
  • The total change returned
  • The total change given to the nearest nickel

The double constants are for storing:

  • The tax rate
  • The cost of the brushes
  • The cost of the paint
  • The cost of the primer

To declare a named constant add the keyword final before the type. For example, the following line declares a constant double called cost:

final double cost;

Part Two: Handling Input

Now that we have completed the first task of setting up variables, we need to program a sequence of prompts, calculations and some printing to the terminal. The following pseudocode gives you a good overview of what needs to be done. Pseudocode is a great tool to start writing a program without technical details slowing us down.

//Pseudocode:
Print out "Welcome to ArtSupply"
Prompt for cashier's name.
Prompt for number of brush sets.
Prompt for number of primers.

Calculate product total.
Print product total.

Calculate tax.
Print tax.

Calculate total.
Print total.

Prompt for money received.
Print the money received.

Calculate change due.
Print the change due.

Calculate change rounded up to the nearest nickel.
Print change rounded up to the nearest nickel.
Print cashier's name.


To prompt for input, use the JOptionPane class. To understand how to use the JOptionPane for input, read [Input_using_JOptionPane Input Using JOptionPane]. In order to get input, use JOptionPane's showInputDialog method. This method returns the text the user typed into the input dialog box as a string. Store that text in a String variable. This can be simply done roughly like this:

someStringVariable = JOptionPane.showInputDialog("What is your input?");

Once we have the input text stored, we want to print out the string value and move the cursor to a new line. We can do this by using the System.out.println("<text>") function. Continue on by prompting the user to enter in 3 numbers using JOptionPane. Each time the user enters a number we want to convert the entered value to an integer and print the number. The following code illustrates how to convert the entered value to an integer:

someIntegerVariable = Integer.parseInt(StringVariable);

This method parseInt works well so long as the user enters a number and not something else. This means that the user could crash the program by not entering a number when they are supposed to. The correct way to fix this potential problem is to do error checking. However, for the sake of simplicity, we will assume that the user always enters a number.

After the inputs are entered and properly stored, we need to do some math. Proceed by calculating the subtotal, tax and the total amount using simple math equations. After the values are calculated, print the subtotal, the tax, and the total amount. Make sure the output is in the same order as the output shown in the problem description.

You are now about half way done this program!

Part Three: Output

Now the cashier is waiting for the customer to pay. Assuming the customer is not a thief, they would hand the cashier an amount greater than or equal to the total amount owing. This means we do not need to error-check to make sure the customer gives the cashier a proper amount (meaning that the customer did not shortchange the cashier).

Use JOptionPane to prompt for an amount given, and then convert the string returned to a double (again assume they enter a proper number, so that no error checking is needed). The following code shows how to convert a string to a double:

DoubleVariable = Double.parseDouble(StringVariable);


Print the amount given. Calculate any change the cashier needs to give to the customer and print it (even if it is $0.00). Round the amount of change to the nearest nickel and print that value.

Your code is now complete!

Post-programming Instructions

Now you may want to close your program, submit it and be happy that you're done! Unfortunately, reality doesn't work that way. You are only about half done with your program. Now you need to make sure your program works, and is up to standards. Below are a few steps you need to take when you feel you have finished your program.

Look it over

After your program is working, check for efficiency. This will come into play later on in the Computer Science degree, but you should practice doing it now. The next two sections are some methods to help you become more efficient.

Fix the Errors in the Code

If you have any bugs in your program, check them over and fix them!

Optimize the Code by Removing Unnecessary Variables

At the top of the main method, you should have a number of variables. If you have any more than what the above solution suggests, see if you can get rid of any extras you don't need.

Try to Break your Program

In this question, breaking your code would be easy to do unless you implement the error-checking procedures. You could easily break your code by entering in a letter instead of a number and trying to convert that string into an integer or double. However, if you do implement the error checking procedures in this program, and for your future programs, the best way to make sure you have complete and fantastic code is if you cannot make your program explode no matter what you do. The number one reason individuals are penalized for their code is because a random situation arises, even though it's highly unlikely to happen (but they do), and the programmer has not added the necessary code to handle the exception.

The Feeling of Hopelessness

There will be times that arise when you've gone too far down one path and your code is too far gone to fix properly. Understand that at times completely restarting the whole program over is a quicker and saner option than attempting to fix it properly. In other cases, backing up part way is more efficient. Make sure you save working versions of your program along the way. Lastly within this section, back up your code! If your computer dies and you lose your file, that's your responsibility!

Parting Statements

Remember that this is not the only "correct" way to do this program. There can be many different ways to accomplish this program and it can be further developed to handle error-checking from any aspect. Remember to code efficiently, accurately, and properly. This means: no more excess code than needed, know what you're trying to code and break it down as needed to accomplish parts of it at a time rather than the whole thing in one sitting, and comment and indent your code appropriately. Always remember to test your program as much as you possibly can, and practice, practice, practice! The more you code, the better you will become at it.

Code

Solution Code

Back to the Case Studies homepage