eclipse - Java-OOP I keep on getting this strange output -


I am currently taking computer science at school and I am a little trapped in my laboratory. Instructions are listed below and we need to use an OOP. The problem is that my output is super funny and I really do not know what's going on.

The output that I get after running the file is DiscountRunner.java (the code listed below):

  Enter the original bill amount: 4000 discount @ 1d1be4e   

Why do not I get discount @ 1d1b4e part?

  / ** ===================================== ================================================== =========================== * Purpose: This laboratory was designed to teach you that if statements are used. * Description of Lab: Any person should determine the amount of exemption. * If the bill is more than 2000, then the person should get 15% off. * If the bill is $ 2,000 or less, then the person does not get any kind of discount. ================================================== ================================================= * / Import static java.lang.System. *; Import java.util.Scanner; Public category discounter {public static zero main (string [] args) {scanner keyboard = new scanner (System.in); outside. Print ("Enter the original bill amount:"); Int amt = keyboard.nextInt (); Int discount; Discount bill = new discount (); Bill.getDiscountedBill (); Println (bill); // Print the output of the bill to make a new discount object called "Bill" immediately. GatesConnectedBill () as the parameter of AMT}}   

This file is one.

Here are two files.

  Import static java.lang.System. *; Import java.util.Scanner; Public category discounts {// example variables and constructors can be used, but are not really necessary; Int bill; // getDiscountedBill () will return the last bill of the bill // if the bill is> 2000, the bill gets a 15% discount, public int discountbill (if (amt> 2000) bill = amt * (int) .85; If (amt & lt; = 2000) bill = amt * 1; Return bill; }}    

You get some small errors of type conversions and method to get some value . Find below job code

  import static java.lang.System *; Import java.util.Scanner; Public category discounters {public static zero main (string [] args) {scanner keyboard = new scanner (System.in); Discount bill = new discount (); outside. Print ("Enter the original bill amount:"); Bill.amt = keyboard.nextInt (); Int discount; Discount = bill.getDiscountedBill (); Println (discount); // Instant a new discount object named "Bill" // Print the output of the bill. Import static static java.lang.System with AMT as badge () parameter) *; Import java.util.Scanner; Public class discounts {// instance variables and constructors can be used, but in reality AMT is not needed; Int bill; // getDiscountedBill () will return the last bill of the bill // If the bill is> 2000, then the bill gets a 15% discount. Public int discountbill (if (amt> 2000) ** bill = (int) ( AMT) * .85); ** If (AMT & lt; = 2000) bills = AMT * 1; Return bill; }}   

Tell me if you are not getting anything If you have a problem solved then accept the answer.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -