Giter Club home page Giter Club logo

ctalkobt_pf_answer's Introduction

: GroceryItem.java :

  • added -> line 17: GRAPEFRUIT('G', 0.50, "GrapeFruit"),//The new one
  • modified line 27: public final char match; //Before it was String This modification is probably a better way, instead of String I decide to use char for item product.
  • Modified other lines eg, 44 to get String.valueOf when char is find it.

: ShoppingCart.java : +eg, line 46 added String.valueOf for getting the String representation of a char

  • lines 65, 66 instead of int I decide to have a double variable for better precision in the cart.

: Discount.java : Lines 25, 39 the app return double instead of int. this was a decision for getting a better precision Lines 18,19 //Apple, Orange, Banana, Grapefruit to 1.25 new Discount( 1.25, GRAPEFRUIT, APPLE, ORANGE, BANANA), I used the new discount directly get the price of 1.25 and it's the first one to execute so, when the cart is filled with that products there it goes for 1.25

: ShoppingCartMain.java :

  • line 46: double totalPrice instead of int totalPrice +line 47: Instead of divide everytime by 100, I decide to have a double variable. and replace the line: System.out.format("Price : %.02f", totalPrice); //* It was divided by 100 every time it calculates the result

ctalkobt_pf_answer's People

Contributors

hernan-gil avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.