I need a tutor in order to pass my class in Java Programming!

I'm having a lot of trouble keeping up in my online course. Because there is no class room, I find it difficult to ask questions. The time lap between question and answer makes it extra difficult to concentrate and stay focused on the problem. I would really like someone to be my tutor. Corresponde via email so that I can get help quicker and stay on track.
I'm suppose to write an array in order to keep inventory. I have no idea where to even start. Here is the assignment, if you can help me and point me in the right direction, or show an example of codes I can use, it would be greatly appreciated.
1) Create a product class that holds the item number, the name of the product, the number of unites in stock, and the price of each unit.
Item # 1, Red Hanging Candle Holder, 24, $12.00
Item # 2, Blue Hanging Candle Holder, 24, $12.00
Item # 3, Green Hanging Candle Holder, 24, $12.00
Item # 4, Yellow Hanging Candle Holder, 24, $12.00
2) Create a Java application that displays the product number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory (the number of units in stock multiplied by the price of each unit).

God bless, Darryl. My time is more valuable to me.
Maybe this arrangement works because you need the
instruction as much as the OP does. The only
question is: who will provide it? If neither person
knows more than a month's worth of Java, how is new
information brought in?
Thanks duffymo for your blessing. As programming is just a hobby for me -- since 1983 -- I agree that my time is (much much) less valuable than yours. And yes, I expect the learning process to be mutually beneficial. And while I don't plan to make my living off java, I believe in doing things correctly or not at all. My one month experience in Java is backed up by programming in more languages than most professionals use in a lifetime, on platforms starting from pre-DOS systems with CTDs and a single-line display through DOS, xenix, PDP-11, MicroVAX and every version of Windows from 95 onwards.
In any case, don't you think it would help if the simplest of questions were kept off these forums and solved in mutual self-help groups? some of whose members had nore time than others to spend on Googling and searching the forums? The first benefit would be to those who have progressed beyond the obvious, as you seniors would have more time to answer their pleas for help instead of getting bogged down in badly or unformatted code with all the trappings of cut-n-paste, meaningless comments that seem to be intended more for the teachers than the learners -- I could go on and on.
I apologise for what I'm about to do; I do really agree with the general feeling on the forums that OPs benefit much more from being guided towards their goal than from being spoonfed a code that works. But I would really appreciate your critique of this code, which is my first console application. It took about half an hour, including Googling. I am aware that there are absolutely no comments, and the output columns don't line up, due to my as yet inadequate knowledge of output formatting. Anything else you can point out would help me in my learning process.
Thanks for your time, Darryl
File Inventory.javapublic class Inventory
    public static void main (String args [])
        int[] itemNumbers   = { 1,
                                2,
                                3,
                                4
        String[] itemNames  = { "Red Hanging Candle Holder",
                                "Blue Hanging Candle Holder",
                                "Green Hanging Candle Holder",
                                "Yellow Hanging Candle Holder"
        int[] unitsInStocks = { 24,
                                24,
                                24,
                                24
        double[] unitPrices = { 12.0,
                                12.0,
                                12.0,
                                12.0
        Product[] products = new Product[4];
        for ( int i = 0; i < products.length; i++)
            products[i] = new Product(itemNumbers,
itemNames[i],
unitsInStocks[i],
unitPrices[i]);
double productValue = 0.0;
double totalValue = 0.0;
System.out.println("Item #\t" +
"Name\t" +
"Units in stock\t" +
"Unit price\t" +
"Total Cost");
for ( int i = 0; i < products.length; i++)
productValue = products[i].get_productValue();
totalValue = totalValue + productValue;
System.out.println(products[i].get_productDetails() + "\t" +
Double.toString(productValue));
System.out.println("");
System.out.println("\t" +
"\t" +
"\t" +
"Grand Total\t" +
Double.toString(totalValue));
File Product.javapublic class Product {
    private int itemNumber;
    private String itemName;
    private int unitsInStock;
    private double unitPrice;
    private Product()
    public Product(int    itemNumberIn,
                   String itemNameIn,
                   int    unitsInStockIn,
                   double unitPriceIn)
        itemNumber   = itemNumberIn;
        itemName     = itemNameIn;
        unitsInStock = unitsInStockIn;
        unitPrice    = unitPriceIn;
    public double get_productValue()
        double unitValue = (double) unitsInStock * unitPrice;
        return unitValue;
    public String get_productDetails()
        String productDetails = Integer.toString(itemNumber) + "\t" +
                                itemName + "\t" +
                                Integer.toString(unitsInStock) + "\t" +
                                Double.toString(unitPrice);
        return productDetails;
}The forum software seems to have reduced my indentation by 1 space in many lines, they line up correctly in Notepad.
Message was edited by:
Darryl.Burke

Similar Messages

  • Passing Japanese characters to Java program

    Hi,
    I am using Java POI APIs for creating/modifying excel spreadsheets. The platform is Solaris. The data to be populated contains both English as well as Japanese characters. The input data to Java program comes from a perl program. When I populate the data in excel or even print using System.out.println, it prints ???... for Japanese characters. The data is in SJIS format.
    I tried converting it to UNICODE in java but that doesn't seem to be working.
    I also tried using native2ascii for converting the data to UNICODE before it is fed to Java program using the following command
    native2ascii -encoding SJIS <Input File> <Output File>
    Although it converts the charaters into UNICODE correctly in the form \u8a3c\u523... but when it is input to Java, the program prints the string as such.
    But if this string is hardcoded in the program, the Japanese characters are printed correctly.
    Could anybody please throw some light as to the data should actually be passed to the Java program.
    Thanks

    Sekhar
    Ive realised the solution will probably involve HttpServletRequest.setCharacterEncoding.
    Im now upgrading to Tomcat 4 because 3 didnt support this method. Once I'm through the upgrade, I'll try Japanese the chars again.
    I would guess I need to force my web pages to utf-8 and use HttpServletRequest.setCharacterEncoding(utf-8) in the servlet to get it working ?

  • How to pass arguments to a java program.

    I want to pass a file name to java program while it is going to execute.
    ex: c:\>java <.class> <filename>
    so that i have to take that filename into a string. Is it possible? If it is possible please help me.
    and how can i check whether the filename argument is given or not through command line argument?

    public class Program{
    public static void main(String[] args){
    filename = args[0];
    static String filename;
    this code is working. But if I did not give filename, and I only give like this
    java Program
    Then how can i now whether the argument (args[0]) is passed or not?

  • Can't pass params in xsql java program

    I tried xsql java program in the xml dev guide.
    It seems that the program failed to recognize the params.
    Here is my code:
         Hashtable params = new Hashtable (3);
         params.put("docid", "801");
         params.put("orderby", "citeid");     
         params.put("xml-stylsheet", "none");
         req.process(params, new PrintWriter(System.out), new PrintWriter(System.err));
    I used the command line to run the xsql page with 2 params above, and it works fine.
    Does anyone know how to solve this problem?
    thanks,

    Ignore this post. Seems one package was in an 8.1.5 calling the xmldom packages in an 8.1.6 database. Problem fixed by moving calling package to the same database.

  • I do not have the 'Advanced' tab on the menu bar. I am trying to change ringtone on my iphone 4s. Have done the following: Right cick on song, entered the start and stop times, but unable to proceed as need 'Advanced' tab in order to change to option.

    I do not have the 'Advanced' tab on the menu bar. I am trying to change ringtone on my iphone 4s. Have done the following: Right cick on song, entered the start and stop times, but unable to proceed as need 'Advanced' tab in order to change to option.

    You don't need to upgrade your software.  But if you're struggling with Spry, IMO you should cut your losses and switch to something better for the longrun.
    If you have a budget to work with, I highly recommend Project Seven's Pop-Menu Magic 3.  It's easy to use in DW CS4, 5, 6 or CC.  More importantly, it's bullet proof and works in all devices. 
    Pop-Menu  Magic3 by PVII (commercial DW extension)
    http://www.projectseven.com/products/menusystems/pmm3/index.htm
    If you don't have a budget to work with, you can roll your own menus with jQuery plugins.  A bit more effort on your part, but they perform better than Spry.
    jQuery Superfish
    http://users.tpg.com.au/j_birch/plugins/superfish/
    jQuery MegaMenu2
    DEMO:
    http://www.geektantra.com/projects/jquery-megamenu-2/
    DOWNLOAD:
    http://code.google.com/p/jquery-megamenu/
    Nancy O.

  • What do I need to buy in order for my iPod Classic 160GB to connect with my blue tooth speaker

    What do I need to buy in order for my IPod Classic 160 GB to connect with my blue tooth Ultimate Ears Boom speaker?

    Upgrading RAM and your HD will give you some performance gains, but depending on what you are doing, it may not be enough. Your best friend will always be processor speed. This has a direct relation to how many cores and the speed of the RAM.
    However, if you are unable to spring for a new computer, then the options of running more RAM and a biggger, faster HD should ruduce some bottle necks.
    Here is a site where you can check out what your computer can handle http://eshop.macsales.com/shop/memory/Apple_MacBook_MacBook_Pro/Upgrade They have some charts comparing speed gains with various components.
    Are you using the track freeze option to manage the track count and subsequent demands on your machine?

  • Need to Split Sales Order Line Item in VA01

    Hi,
      I have a requirement in which i have to split an order line item for KMAT materail number. system popup configurable screen, here all the required characteristic values have to be selected as per the customer requirement.
    After entering all the required customer specific characteristic values, system determines batch automatically. If characteristic values of the Batch matches with the characteristic values of configurable screen selected in the sales order
    Here also we have to check the sales Order Quantity (VBAP u2013 KWMENG) and order Confirmed quantity (VBEP u2013 BMENG), if the both the quantities are not same, consider order has partially confirmed.
    If Order quantity is partially confirmed, check for the batches with the same characteristic values of the quotation configurable screen and if batch found, system has to create a one more line item and new batch has to be assigned to create line item.
    Reduce the order quantity equal to the confirmation quantity in the first line item.
    Create a new line item in the quotation, copy all the remaining unconfirmed quantity from the first line item and also copy all the characteristics and properties (item category, schedule line category, business data, item data, and requirement type) and assign the batch to the new line item. System does the availability check automatically and confirms.
    In another scenario system doesnu2019t find batch, in this case capable to promise has to trigger directly.
    Here we have to check the Order confirmed quantity, if confirmed quantity is equal to zero.
    Change the item category of the line item, due to which system determines different Requirement type and schedule line category.
    Based on the Requirement type system triggers the capable to promise.
    I would lke to know which is the suitable user eixt or BADI to split the line items and what all the tables or structures i need to populate in order to create a new line item successfully.
    I have seen many post in sdn but no body gives the right user exit name where i can add new line item.
    Regards,

    Hi Amit,
      Thanks for your reply. In this scenario configurable material is involved. And first Make to Stock scenario is executed to check any material with customer entered characteristics are avialable. If its so it will determine its batch and assigned the quantity.
    If zero quantity is assigned or no quantity is assigned then I have to trigger the Make to Order scenario for rest of unconfirmed quantities in order.
    I have check it in USEREXIT_MOVE_FIELD_TO_VBAP but it was of no use. I even tried in USEREXIT_CHECK_VBAP but still no result. I am not sure what all the tables and structures i need to populate there.
    Regards,

  • HP 15-d030nr: What Upgrades Do I Need To Make In Order To Be Able To Use Adobe After Effects CS6?

    HP 15-d030nr, what upgrades do I need to make in order to be able to use adobe after effects cs6?
    I installed Adobe After Effectss CS6 because I was told by HP Support that it would still work; it doesnt.  It is very slow, and locks up bad.  What upgrades do I need to do, or am I looking at having to go buy another labtop?  Also, can I do these upgrades myself - at what cost?
    **HP 15-d030nr**
    Hardware
    Product Name 15-d030nr
    Product Number F5X99UA
    Microprocessor 2.0GHz Intel Pentium N3510 Processor
    Microprocessor Cache 2MB L2 Cache
    Memory 4GB DDR3L SDRAM (1 DIMM)
    Memory Slots 2 user accessible
    Video Graphics Intel HD graphics
    Display 15.6-inch diagonal HD BrightView LED-backlit touchscreen display (1366x768)
    Hard Drive 500GB 5400RPM hard drive
    Multimedia Drive SuperMulti DVD burner
    Network Card 10/100BASE-T Ethernet LAN (RJ-45 connector)
    Wireless Connectivity 1x1 802.11b/g/n WLAN
    Sound HD Audio with stereo speakers
    Keyboard Full-size island-style keyboard with numeric keypad
    Pointing Device Touchpad supporting multi-touch gestures without on/off button
    External Ports Multi-format digital media card reader for Secure Digital cards 1
    SuperSpeed USB 3.0
    2 Universal Serial Bus (USB) 2.0
    1 HDMI
    1 VGA (15-pin)
    1 RJ-45 (LAN)
    1 Headphone-out/microphone-in combo jack Dimensions 1.11 in (H) x 14.88 in (W) x 10.20 in (D) Weight 4.96 lb Power 45W AC adapter
    3-cell 31WHr 2.8Ah lithium-ion polymer battery ID Mech Description Front facing HP TrueVision HD Webcam with integrated digital microphone
    **After Effects CC (2014) system requirements and language versions Windows**
    Intel Core2 Duo or AMD Phenom II processor with 64-bit support
    Microsoft Windows 7 with Service Pack 1, Windows 8, or Windows 8.1
    4 GB of RAM (8 GB recommended)
    5 GB of available hard-disk space; additional free space required during installation (cannot install on removable flash storage devices)
    Additional disk space for disk cache (10 GB recommended)
    1280 x 1080 display
    OpenGL 2.0–capable system
    QuickTime 7.6.6 software required for QuickTime features
    Optional: Adobe-certifi ed GPU card for GPU-accelerated ray-traced 3D renderer
    Internet connection and registration are necessary for required software activation, validation of subscriptions, and access to online services.*
    *I also have a 1TB external hardrive*
    This question was solved.
    View Solution.

    Your problem is that the program wants a good video card and a fast hard drive and lots of memory and you have none of the above. If you upgraded the RAM to 8 gigs and installed a solid state hard drive you might make the program useable but the real bottleneck  is going to be the Intel HD graphics, which cannot be upgraded. 
    You do have an open slot to add one 4 gig memory module. This is an easy relatively inexpensive upgrade. See here:
    https://www.youtube.com/watch?v=L7FvZ-JduRM
    http://www.crucial.com/usa/en/ct51264bf160b
    I would try this a step at a time. Next would be the solid state drive. That would cost maybe $150. Post back if you need more help. 
    If this is "the Answer" please click "Accept as Solution" to help others find it. 

  • I need to be able to right click on a saved document and have the option to convert to Adobe PDF. I have the Abobe Acrobat Xl Pro and used to have this option until I had to create a new subscription. What do I need to do in order to have this option?

    I need to be able to right click on a saved document and have the option to convert to Adobe PDF. I have the Abobe Acrobat Xl Pro and used to have this option until I had to create a new subscription. What do I need to do in order to have this option? I use windows 7

    If you are New to Mac... you may also find these links of Value
    Mac 101
    http://www.apple.com/support/mac101/
    http://www.apple.com/support/switch101/     Switching from PC
    MBP Support
    http://www.apple.com/support/macbookpro
    Cheers,

  • What is the need of creating New order type in PO

    Dear Experts,
                 I have a doubt in MM, what is the need of creating New Order Types?  Please explain with Business scenario.  Thanking you,
    Regards,
    Elangovan.A

    Hi Elangovan
    Whenever you have a doubt like this...
    --- just verify the config settings for your parameter (order type here).
    ---Also check whether authorizations can be given for this ?
    ---Do you need it for specific analysis ? Are there standard reports/listings available ?
    So, some of the uses of order type are:
    1) What are the parameters controlled by order type ?
    It controls the number ranges and screen layouts etc. So, if you want to have different set of number ranges and different screen settings, then you may need a new order type.
    2) Authorizations can be controlled with order type.
    3) You can also use it in analysis/listings
    Best regards
    Ramki

  • Just installed vista and bootcamp won't install because it needs windows 7 in order to install properly

    Hey so i just bought by 15" MacbooK Pro yesterday and wanted to install windows vista on it. I'm to the part where you're supposed to install windows bootcamp but a message comes up saying that it needs windows 7 in order to install properly. What do i do?? I have the upgrade version of windows 7 (whcih i was going to eventually install) but when i tried installing it an error message came up saying that it needs vista service pack 1 to install. In order to install that service pack I need to connect to the internet. I can't connect to the internet, though, without installing the drivers from bootcamp!! AHH! see how this is frustrating? PLEASE HELP ASAP!

    Reboot your computer while holding down the option key. You should be presented with the option to boot into OSX. Once booted into OSX start Boot Camp Assistant and select remove the Boot Camp Partition.
    I know Boot Camp Assistant was not installed in Windows. It is an OSX application for creating and removing a Boot Camp partition. It is run from OSX.

  • I have made a bootable copy of ML and want to load it on another laptop running SL. What do I need to do in order to avoid losing any files. I do not want to do a clean install.

    I have made a bootable copy (8GB thumb drive) of ML and want to load it on another Apple laptop running SL. What do I need to do in order to avoid losing any files. I do not want to do a clean install. I know ML is comptible.

    I'm getting an error message when ML is almost completely installed and it stops the install. Is there any way to get back to the snow leopard operating system and scrap the ML install at this point. I had to shut the Mac book off and when I started again it tried to install ML a second time. It is still trying to install but at this point I don't want to screw anything up any further so just want to get back to SL.
    Any suggestions.

  • Need to modify Sales order Item additional tab B

    Hello all,
    I need to modify Sales order item additional tab B ...by removing the exisitng fields and should add some new fields ....does it have any impact on this screen could be used in any of the other transaction .......i  just wanted if we remove the fields and some new details will have some impact
    Regards,
    KK

    Additional data B is used to add your own fields also known as custom fields in sales order.
    Custom fields can be added to tables VBAK & VBAP (depending on header or item). Similarly you can remove fields if you don't require it anymore.
    In short, your requirement can be met but you have to take help of ABAP consultant since it requires maintenance of user exits and modification of screens.

  • Need code for sales order create report using bapi's

    need code for sales order create report using bapi's

    Hi,
    Go through below link
    http://www.saptechies.com/bapi_salesorder_createfromdat2/
    <b>Reward points if it helps,</b>
    Satish

  • I need to make the ordered quantity field (RV45A-KWMENG) disabled in 'VA02'

    Hi SAP COMMUNITY,
    I have urgent requirement for which i did'nt worked before on this requirement. I hope you people can help me in this regerd.
    My requirement is, I need to make the ordered quantity field (RV45A-KWMENG) disabled in the transaction code is VA01/VA02. User should not be able to edit this ordered quantity in VA01/VA02 Transaction.
    Here the condition to disable this field ordered quantity is IF ORDER TYPE EQUAL TO OR AND IF ITEM CATEGORY EQUAL TO TANN in technical IF VBAK-AUART EQ OR AND IF VBAP-PSTYV EQ TANN then only the field (RV45A-KWMENG) ordered quantity should be disabled in that transaction VA01/VA02.
    Correct me if iam wrong, I think in the program SAPMV45A and do we need to include any screen number which i have seen in VA02 is 4001. Do we need to write a code in Include MV45AFZZ (FORM USEREXIT_FIELD_MODIFICATION.). But i don't know what code i need to write here to disable this field.
    I had searched in the forum some example code so please suggest me whether i can use this and if i can use this please suggest me how to write the condition and insert the code in that FORM. If this sample code is wrong then please suggest me what exact code should be given. Can anyone help. Quick response will be much appreciated.
    Looking forward for ur prompt replies.

    As per my understanding , To disable the field RV45A-KWMENG based on the condition for Transaction VA01/VA02.
    The conditions which i need to check is Order Type and item category.
    I understand that this is the code which i need to insert for disabling the field but i have a question here, where is the condition here and how the system understand for this field RV45A-KWMENG it has to disable. I think we need give the condition as if RV45A-KWMENG....... Another one if iam not wrong we need check that it has to be done in VA01 and VA02 then only this condition should be executed.
    IF VBAK-AUART EQ 'XXX' OR VBAP-PSTYV EQ TANN .
    IF SCREEN-NAME = 'XXX'.
    SCREEN-ACTIVE = 0
    ENDIF.
    ENDIF.
    Please suggest me the better way how can i do it in the coding.
    Awaiting for ur prompt reply.

Maybe you are looking for