Instructions
Objective
Write a java assignment program to implement corgi workshop.
Requirements and Specifications
********Build-a-Corgi Workshop********
- Write the pseudocode for the following program.
- Create a flowchart.
- Design a program based on the below information.
********Build-a-Corgi Workshop: Scenario********
Three children are going to the build-your-own stuffed Corgi workshop with a group of Corgi fans. Each child is allowed to spend no more than $30.00 and they have their own cash!
Based on the three children’s selections, calculate the total amount due for the stuffed Corgi. Calculate how much change each child receives, if they do not spend the entire $30. Force a new selection if the child spends more than $30.00. The cashier has unlimited denominations and coin varieties to make the exact change. Use all of the information you have learned in Chapters 1-8 to create an elegant program.
- Proper naming conventions.
- Proper use of comments.
- Using objects.
- Providing well-formatted user output.
- Concise writing of code, if you can write it in two lines instead of five, two lines is typically nicer.
- Do not write repetitive code.
- Use proper methods/syntax.
- Using arrays.
- Using sentinel value.
- Code is formatted properly.
- Code output is formatted as if it were a receipt
- Error check user input as needed to run program properly.
Source Code
import java.text.SimpleDateFormat;
import java.util.Date;
public class CorgiWorkshop {
// This our constants to easier to read the array of money denominations
private static final int TENS = 0;
private static final int FIVES = 1;
private static final int ONES = 2;
private static final int QUARTERS = 3;
private static final int DIMES = 4;
private static final int NICKELS = 5;
private static final int PENNIES = 6;
// $10 = 1000 pennies
// $5 = 500 pennies
// $1 = 100 pennies
// Quarter = 25 pennies
// Dimes = 10 pennies
// Nickels = 5 pennies
// This will be useful for calculating based on the available bills
private static final int[] PENNIES_DENOMINATIONS = {
10 * 100,
5 * 100,
100,
25,
10,
5,
1
};
// Initialize available items and prices
private static final String[] FURS = {"Large Red and White", "Large Tri-color"};
private static final double[] FUR_PRICES = {12, 13.50};
private static final String[] OUTFITS = {"Shark", "Mermaid", "Swim trunks"};
private static final double[] OUTFIT_PRICES = {6.49, 8, 6.99};
private static final String[] SOUNDS = {"Puppy 5-in-1 sounds", "Personalized message", "I love you", "Heartbeat"};
private static final double[] SOUND_PRICES = {4.49, 3.47, 2.99, 2.49};
private static final String[] ACCESSORIES = {"Beach ball", "Pet carrier", "Radio flyer wagon", "Water cooler"};
private static final double[] ACCESSORY_PRICES = {3.50, 7.99, 10, 3.29};
// Create a starting money for a customer
// Start with 1 x $10, 2 x $5, 6 x $1,
// 6 quarters, 10 dimes, 20 nickels, and 50 pennies
private static int[] initializeStartingMoney() {
int[] money = new int[7];
// These all stores the pennies rate of each bill
money[TENS] = 1 * 10 * 100;
Similar Samples
Explore our curated samples at ProgrammingHomeworkHelp.com to witness expertly crafted solutions across various programming disciplines. Our samples exemplify clarity, efficiency, and adherence to best practices, offering valuable insights into our commitment to delivering top-notch programming assistance. Dive into our collection to discover how we can elevate your understanding and performance in programming tasks.
Java
Java
Java
Java
Java
Java
Java
Java
Java
Java
Java
Java
Java
Java
Java
Java
Java
Java
Java
Java