Help for a Beginner's Program

Hello, I'm fairly new to the Java language. Recently I was writing a program revolving around the creation of classes and constructors...my code looks like this:
import java.util.Scanner;
class Money{
     private static int dollars, cents;
     Money(int dollars, int cents){
     Money(int dollars){
     Money(){
     static Money add(Money n,Money n2){
          return (n + n2);
     static Money minus(Money n,Money n2){
          return (n + n2);
     public static boolean equals(int m, int m2){
          if((m == dollars) && (m2 == cents));
               return true;
     public String toString(){
          return ("Dollars = "+ getDollars() + " " + "Cents =" + getCents());
     public static int getDollars(){
          return (dollars);
     public static int getCents(){
          return (cents);
     public static void setDollars(int n){
          dollars = n;
     public static void setCents(int n2){
          cents = n2;
class Program2_5{
     public static void main (String [] a) {
          Scanner kb= new Scanner (System.in);
          System.out.println ("Enter the amount of dollars");
          int d=kb.nextInt();
          System.out.println ("Enter the amount of cents");
          int c=kb.nextInt();
          Money.setDollars(d);
          Money.setCents(c);
          System.out.println (Money.toString());
The main part of my code is just to simply make sure the methods actually work. When i go to compile my code I get three errors revolving around three specific lines.
Error 1= {Operator + cannot be applied to Money, Money}
*static Money add(Money n,Money n2){*+
*     return (n n2);*+
Error 2= {Same as Error 1}
*static Money minus(Money n,Money n2){*+
*     return (n n2);*+
Error 3={non-static method toString() cannot be referenced from a static context}
*public String toString(){*+
*     return ("Dollars = " getDollars() + " " + "Cents =" + getCents());*+
In order to fix Error 3 i tried to place static in front of String toString() but got an error about the Money String toString() cannot override the Object StringtoString()
I have been working with this program for hours on and off and would really appreciate it if someone with more experience could help me...Thank You

I think there are a few things that could help you out. Firstly, amounts are generally not looked at as dollars and cents separately. You can always go back and change it, but I'd code it a bit more like this:
import java.util.Scanner;
public class Money {
  private double amount;
  public Money() {
    this(0.0);
  public Money(double amount) {
    setAmount(amount);
  public void setAmount(double amount) {
    this.amount = amount;
  public double getAmount() {
    return(amount);
  public void add(double amount) {
    setAmount(getAmount()+amount);
  public void minus(double amount) {
    setAmount(getAmount()-amount);
  public boolean equals(double amount) {
    if (getAmount() == amount)
      return true;
    return false;
  public String toString() {
    return ("Amount = "+getAmount());
  public static void main (String [] argv) {
    Scanner kb= new Scanner (System.in);
    System.out.println("Enter initial amount");
    double a=kb.nextDouble();
    Money money = new Money(a);
    System.out.println(money.toString());
    System.out.println("Enter amount to add");
    a=kb.nextDouble();
    money.add(a);
    System.out.println(money.toString());
    System.out.println("Enter amount to subtract");
    a=kb.nextDouble();
    money.minus(a);
    System.out.println(money.toString());
    System.out.println("Enter amount to compare");
    a=kb.nextDouble();
    System.out.println(money.equals(a));
}Hope it helps you out.

Similar Messages

  • CS3 - Classroom in a Book - Help for real beginner please!

    I'm literally only on lesson 4 of this course so please forgive my ignorance!  Using the Quick Selection Tool the course tells me to "  Choose Edit > Copy and Edit > Paste to paste the selection on a new layer."  I get a message which says "could not complete the Copy command because the selected area is empty".
    I'm sure there is a simple explanation but I just can't find it - please can anyone help this pure beginner from going entirely mad?
    Judy

    Is the layer that you want to copy from the active layer?  In the example below I used the quick selection tool to select some of the image (you can see the "marching ants" in the lower right corner), but since a new empty layer is active and not the layer I want to copy from, the error message you describe is displayed.

  • Challange for you, help for me! java program

    I am a beginning java student and desparately (again) in help of someone who will check my java program. See below what they want from me, and try to make a program of it that works in all the ways that are asked. Thank you for helping me, i am running out of time.
    Prem Pradeep
    [email protected]
    Catalogue Manager II
    Specification:
    1.     Develop an object to represent to encapsulate an item in a catalogue. Each CatalogueItem has three pieces of information: an alphanumeric catalogue code, a name, and a price (in dollars and cents), that excludes sales tax. The object should also be able to report the price, inclusive of a 15% sales tax, and the taxed component of the price.
    2.     Data input will come from a text file, whose name is passed in as the first command-line argument to the program. This data file may include up to 30 data items (the program will need to be able to support a variable number of actual items in the array without any errors).
    3.     The data lines will be in the format: CatNo:Description:Price Use a StringTokenizer object to separate these data lines into their components.
    4.     A menu should appear, prompting the user for an action:
    a.     Display all goods: this will display a summary (in tabulated form) of all goods currently stored in the catalogue: per item the category, description, price excluding tax, payable tax and price including tax.
    b.     Dispfay cheapest/dearest goods: this will display a summary of all the cheapest and most expensive item(s) in the catalogue. In the case of more than one item being the cheapest (or most expensive), they should all be listed.
    c.     Sort the list: this will use a selection sort algorithm to sort the list in ascending order, using the catalogue number as the key.
    d.     Search the list: this will prompt the user for a catalogue number, and use a binary search to find the data. If the data has not yet been sorted, this menu option should not operate, and instead display a message to the user to sort the data before attempting a search
    5.     Work out a way to be able to support the inc tax/ex tax price accessors, and the tax component accessor, without needing to store any additional information in the object.
    6.     Use modifiers where appropriate to:
    a.     Ensure that data is properly protected;
    b.     Ensure that the accessors and mutators are most visible;
    c.     The accessors and mutators for the catalogue number and description cannot be overridden.
    d.     The constant for the tax rate is publicly accessible, and does not need an instance of the class present in order to be accessible.
    7.     The program should handle all exceptions wherever they may occur (i.e. file 1/0 problems, number formatting issues, etc.) A correct and comprehensive exception handling strategy (leading to a completely robust program) will be necessary and not an incomplete strategy (i.e. handling incorrect data formats, but not critical errors),
    Sample Execution
    C:\> java AssignmentSix mydata.txt
    Loading file data from mydata.txt ...17 item(s) OK
    CATALOGUE MANAGER: MAIN MENU
    ============================
    a) display all goods b) display cheapest/dearest goods
    c) sort the goods list d) search the goods list
    e) quit
    Option: d
    The goods cannot be searched, as the list is not yet sorted.
    CATALOGUE MANAGER: MAIN MENU
    ============================
    a) display all goods b) display cheapest/dearest goods
    c) sort the goods list d) search the goods list
    e) quit
    Option: b
    CHEAPEST GOODS IN CATALOGUE
    Cat      Description      ExTax      Tax      IncTax
    BA023      Headphones      23.00      3.45      26.45
    JW289      Tape Recorder     23.00      3.45      26.45
    MOST EXPENSIVE GOODS IN CATALOGUE
    Cat      Description      ExTax      Tax      IncTax
    ZZ338      Wristwatch      295.00 44.25      339.25
    CATALOGUE MANAGER: MAIN MENU
    ============================
    a) display all goods b) display cheapest/dearest goods
    c) sort the goods list d) search the goods list
    e) quit
    Option: c
    The data is now sorted.
    CATALOGUE MANAGER: MAIN MENU
    ============================
    a) display all goods b) display cheapest/dearest goods
    c) sort the goods list d) search the goods list
    e) quit
    Option: d
    Enter the catalogue number to find: ZJ282
    Cat Description ExTax Tax IncTax
    ZJ282 Pine Table 98.00 14.70 112.70
    CATALOGUE MANAGER: MAIN MENU
    ============================
    a) display all goods b) display cheapest/dearest goods
    c) sort the goods list d) search the goods list
    e) quit
    Option: e
    Here you have the program as far as I could get. Please try to help me make it compact and implement a sorting method.
    Prem.
    By the way: you can get 8 Duke dollars (I have this topic also in the beginnersforum)
    //CatalogueManager.java
    import java.io.*;
    import java.text.DecimalFormat;
    import java.util.StringTokenizer;
    public class CatalogueManager {
    // private static final double TAXABLE_PERCENTAGE = 0.15;
    // Require it to be publicly accessible
    // static means it is class variable, not an object instance variable.
    public static final double TAXABLE_PERCENTAGE = 0.15;
    private String catalogNumber;
    private String description;
    private double price;
    /** Creates a new instance of CatalogueManager */
    public CatalogueManager() {
    catalogNumber = null;
    description = null;
    price = 0;
    public CatalogueManager(String pCatalogNumber, String pDescription, double pPrice) {
    catalogNumber = pCatalogNumber;
    description = pDescription;
    price = pPrice;
    // the mutators must be most visible
    // the final keyword prevents overridden
    public final void setCatalogNumnber(String pCatalogNumber) {
    catalogNumber = pCatalogNumber;
    // the mutators must be most visible
    // the final keyword prevents overridden
    public final String getCatalogNumber() {
    String str = catalogNumber;
    return str;
    // the mutators must be most visible
    // the final keyword prevents overridden
    public final void setDescription(String pDescription) {
    description = pDescription;
    // the accessors must be most visible
    // the final keyword prevents overridden
    public final String getDescription() {
    String str = description;
    return str;
    // If the parameter is not a double type, set the price = 0;
    // the mutators must be most visible
    public boolean setPrice(String pPrice) {
    try {
    price = Double.parseDouble(pPrice);
    return true;
    catch (NumberFormatException nfe) {
    price = 0;
    return false;
    // the accessors must be most visible
    public double getPrice() {
    double rprice = price;
    return formatDouble(rprice);
    double getTaxAmount(){
    double rTaxAmount = price * TAXABLE_PERCENTAGE;
    return formatDouble(rTaxAmount);
    double getIncTaxAmount() {
    double rTaxAmount = price * (1 + TAXABLE_PERCENTAGE);
    return formatDouble(rTaxAmount);
    double formatDouble(double value) {
    DecimalFormat myFormatter = new DecimalFormat("###.##");
    String str1 = myFormatter.format(value);
    return Double.parseDouble(str1);
    public static void main(String[] args) throws IOException {
    final int MAX_INPUT_ALLOW = 30;
    int MAX_CURRENT_INPUT = 0;
    FileReader fr;
    BufferedReader br;
    CatalogueManager[] catalogList = new CatalogueManager[MAX_INPUT_ALLOW];
    String str;
    char chr;
    boolean bolSort = false;
    double cheapest = 0;
    double mostExpensive = 0;
    String header = "Cat\tDescription\tExTax\tTax\tInc Tax";
    String lines = "---\t-----------\t------\t---\t-------";
    if (args.length != 1) {
    System.out.println("The application expects one parameter only.");
    System.exit(0);
    try {
    fr = new FileReader(args[0]);
    br = new BufferedReader(fr);
    int i = 0;
    while ((str = br.readLine()) != null) {
    catalogList[i] = new CatalogueManager();
    StringTokenizer tokenizer = new StringTokenizer(str, ":" );
    catalogList.setCatalogNumnber(tokenizer.nextToken().trim());
    catalogList[i].setDescription(tokenizer.nextToken().trim());
    if (! catalogList[i].setPrice(tokenizer.nextToken())){
    System.out.println("The price column cannot be formatted as dobule type");
    System.out.println("Application will convert the price to 0.00 and continue with the rest of the line");
    System.out.println("Please check line " + i);
    if (catalogList[i].getPrice() < cheapest) {
    cheapest = catalogList[i].getPrice();
    if (catalogList[i].getPrice() > mostExpensive) {
    mostExpensive = catalogList[i].getPrice();
    i++;
    fr.close();
    MAX_CURRENT_INPUT = i;
    catch (FileNotFoundException fnfe) {
    System.out.println("Input file cannot be located, please make sure the file exists!");
    System.exit(0);
    catch (IOException ioe) {
    System.out.println(ioe.getMessage());
    System.out.println("Application cannot read the data from the file!");
    System.exit(0);
    boolean bolLoop = true;
    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    do {
    System.out.println("");
    System.out.println("CATALOGUE MANAGER: MAIN MENU");
    System.out.println("============================");
    System.out.println("a) display all goods b) display cheapest/dearest goods");
    System.out.println("c) sort the goods list d) search the good list");
    System.out.println("e) quit");
    System.out.print("Option:");
    try {
    str = stdin.readLine();
    if (str.length() == 1){
    str.toLowerCase();
    chr = str.charAt(0);
    switch (chr){
    case 'a':
    System.out.println(header);
    System.out.println(lines);
    for (int i = 0; i < MAX_CURRENT_INPUT; i++){
    System.out.println(catalogList[i].getCatalogNumber() + "\t" +
    catalogList[i].getDescription() + "\t" +
    catalogList[i].getPrice() + "\t" +
    catalogList[i].getTaxAmount() + "\t" +
    catalogList[i].getIncTaxAmount());
    System.out.println("");
    break;
    case 'b':
    System.out.println("");
    System.out.println("CHEAPEST GOODS IN CATALOGUE");
    System.out.println(header);
    System.out.println(lines);
    for (int i = 0; i < MAX_CURRENT_INPUT; i++){
    if (catalogList[i].getPrice() == cheapest){
    System.out.println(catalogList[i].getCatalogNumber() + "\t" +
    catalogList[i].getDescription() + "\t" +
    catalogList[i].getPrice() + "\t" +
    catalogList[i].getTaxAmount() + "\t" +
    catalogList[i].getIncTaxAmount());
    System.out.println("");
    System.out.println("MOST EXPENSIVE GODS IN CATALOGUE");
    System.out.println(header);
    System.out.println(lines);
    for (int i = 0; i < MAX_CURRENT_INPUT; i++){
    if (catalogList[i].getPrice() == mostExpensive) {
    System.out.println(catalogList[i].getCatalogNumber() + "\t" +
    catalogList[i].getDescription() + "\t" +
    catalogList[i].getPrice() + "\t" +
    catalogList[i].getTaxAmount() + "\t" +
    catalogList[i].getIncTaxAmount());
    System.out.println("");
    break;
    case 'c':
    if (bolSort == true){
    System.out.println("The data has already been sorted");
    else {
    System.out.println("The data is not sorted");
    break;
    case 'd':
    break;
    case 'e':
    bolLoop = false;
    break;
    default:
    System.out.println("Invalid choice, please re-enter");
    break;
    catch (IOException ioe) {
    System.out.println("ERROR:" + ioe.getMessage());
    System.out.println("Application exits now");
    System.exit(0);
    } while (bolLoop);

    One thing you're missing totally is CatalogueItem!! A CatalogueManager manages the CatalogueItem's, and is not an CatalogueItem itself. So at least you have to have this one more class CatalogueItem.
    public class CatalogueItem {
    private String catalogNumber;
    private String description;
    private double price;
    //with all proper getters, setters.
    Then CatalogueManager has a member variable:
    CatalogueItem[] items;
    Get this straight and other things are pretty obvious...

  • Help for a beginner

    I AM USING ORACLE DEVELOPER2000 R2.1 (STILL STUDYING IT)AND FIRST I INSTALLED ORACLE 8 PERSONAL EDITION AS A DATABASE ENGINE.
    THE PROPLEM IS THAT I HAD THE PROGRAM READ THE TABLES 'SUMMIT2' FOR THE USER : scott AND THE PASSWORD: tiger. THEN I MAKE IT READ THE TABLES ' SUMMIT2A ' FOR THE USER user1 AND THE PASSWORD : user1.
    THAT WAS USING system, manager. I CAN NOW LOG IN USING SCOTT BUT WHEN I LOG IN USING USER1 IT GIVES ME AN INVALID USER NAME AND PASSWORD.
    I AM USING WIN98. PLEASE HELP...

    you can also invoke any script with a ./<name_of_command>
    for example: ./orainst.sh
    There are also tons of manual pages on how the shell works
    just type: man<name of command you need help with>
    Kevin
    keith barron (guest) wrote:
    : stelar (guest) wrote:
    : : tanks for you help
    : : i have another question.
    : : why i login as root
    : : but cant run oratab.sh?????????????
    : : thanks your frined :stelar
    : : Jim Wartnick (guest) wrote:
    : : : stelar (guest) wrote:
    : : : : hi friends:
    : : : : i download oracle.but cant tar the 805ship.tar,
    : : : : but i cant find the install in orainst directory?
    : : : : why?
    : : : : help me . give me some advice.
    : : : : did i dont full download
    : : : : your friend:stelar
    : : : You should be looking for the file: "orainst" in the
    : : "orainst"
    : : : directory. This file is the executable to install Oracle
    : : 8.0.5.
    : : : It should be there.
    : You should include whatever messages you are getting whenever
    you
    : have a problem (or say there are no messages). My guess is that
    : you are not familiar w/ running a shell script. Are you
    : specifying "orainst.sh". If that doesn't work try (I'm not at
    my
    : linux machine so I'm going on memory) "/usr/bin/sh orainst.sh".
    : If it works, add "/usr/bin" to the path statement in your
    profile
    : (/root/.bash_profile).
    null

  • Code bug help for a beginner!!

    Ok, I've written this code so far. Everything was fine until I got to the IF condition. When I try compiling it it tells me that the 'a' variable in the IF condition expression may not have been initialised, which I don't really understand as it's been declared at the start of the program and even used fine beforehand in the switch statements.
    Any ideas?
    Thanks for any help. Here's the code.
    import javax.swing.JOptionPane;
    public class LetterProgram {
    public static void main (String args[]) {
       String pickALet;
       String output;
       char letter;
       int guess;
       int a;
       pickALet = JOptionPane.showInputDialog ("please enter a lower case letter from (a to e)");
       output = "you selected a letter " + pickALet;
       letter = pickALet.charAt(0);
       switch (letter) {
       case 'a':
       a = 1;
       output = "you entered an a";
       break;
       case 'b':
       a = 2;
       output = "you entered a b";
       break;
       case 'c':
       a = 3;
       output = "you entered a c";
       break;
       case 'd':
       a = 4;
       output = "you entered a d";
       break;
       case 'e':
       a = 5;
       output = "you entered an e";
       break;
       default:
       output = "i did not recognise your entry";
       break;
       JOptionPane.showMessageDialog(null, output, "your letter", JOptionPane.INFORMATION_MESSAGE);
       guess =(int)(Math.random()*5 +1 ) ;
       System.out.println(guess);
       if (guess==a)
          System.out.println("The computer guessed the correct letter");
       else
          System.out.println("The computer guessed the letter incorrectly");
       System.exit(0);

    It's better to add a default label to the switch; otherwise for most cases you will be setting the value twice, and it makes the intent of 'none of the above' clearer.
    Pete

  • Help for a beginner creating a 2d image-processing suite in LabVIEW.

    I am a final year student and currently seeking any advice from experienced engineers with regard to my project.
    The project is to create a LabVIEW based image-processing suite, which would be able to import 2d arrays of data from microscope, plus other information (scaling, date/time, sample info) and perform the following functions:
    Visualisation – 2d & 3d, Cross-section Profile Analysis, Histogram, Fourier Transform, Auto-Correlation, Copy, Print, Save & Export, Colour Palette Edit, Zoom, Manipulate.
    Having not used LabView previously, any examples or information you may have would be of extreme use,
    Thank you in advance for any help you can give me,

    Sam,
    Most of these tools are readily available in LabVIEW when you purchase the IMAQ Vision toolkit. You just need to learn how to use them and set them up. In your case, I would strongly recommend starting with Vision Builder. You can learn how to use a number of these tools, and it may actually be sufficient for your project without writing any code. It can generate LabVIEW code as well, so it would get you started on your program.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • Ideas for a beginner to program

    I've started mentoring a young student - teaching him LabVIEW. He
    is enjoying it and we have covered the basics. Now I need to come up
    with a project for him to start writing a program(s) on his own. For
    the time being, I would like to keep it to calculations/analysis/display
    kinds of things (no Daq hardware). I was wondering if anyone had ideas
    (or previous experience) of such kinds of programs - something
    relatively easy at this point, but useful/fun enough to keep him interested.
    Thanks,
    Dave
    David Thomson Original Code Consulting
    www.originalcode.com
    National Instruments Alliance Program Member
    Certified LabVIEW Architect
    There are 10 kinds of people: those who understand binary, and those who don't.

    Here is an idea for a nice little project would be:
    (assuming no Daq or GPIB hardware).
    Open a binary file. Parse the file to identify the OP codes and operands. Translate it to "english". Display the translation and write it to another file.
    You can expand to opening a serial port, communicating to a serial device. Interpret the data (especially if there is some sort of waveform to analyze). Plot the data "real-time". Display warnings or conditions if low or high limits are reached, or if a number of samples has been achieved.
    Prompt for user intervention (what to do with the data, ie: save it to file, display it, print it, etc). Allow for user control of the vi (Run / Pause / Stop / Abort).
    The above should provide basic functionality where ther
    e is no instrument to control or a data-acquisition system to monitor.
    Are you looking for real projects? Maybe a bit more challenging?
    Regards,
    -JLV-

  • Help for a beginner in utl_file

    Hi,
    As I said I have just begun to learn pl/sql and looks like I am having a big trouble with it. I will attach the code I started with I know it does not do much and useful but can someone please help me run it? When I try to run it it gives the compilation error invalid directory path...
    CREATE OR REPLACE PROCEDURE encrypt_to_file IS
    /* Output variables to hold the result of the query: */
    a ALL_OBJECTS.OWNER%TYPE;
    b ALL_OBJECTS.OBJECT_NAME%TYPE;
    vlocation VARCHAR2(16) := 'OUTPUT';
    vopen_mode VARCHAR2(16) := 'w';
    F1 UTL_FILE.FILE_TYPE;
    /* Cursor declaration: */
    CURSOR TCursor IS
    SELECT OWNER, OBJECT_NAME
    FROM ALL_OBJECTS;
    BEGIN
    OPEN TCursor;
    F1 := utl_file.fopen( vlocation, 'DENEME.TXT', vopen_mode );
    LOOP
    /* Retrieve each row of the result of the above query
    into PL/SQL variables: */
    FETCH TCursor INTO a, b;
    /* If there are no more rows to fetch, exit the loop: */
    EXIT WHEN TCursor%NOTFOUND;
    END LOOP;
    UTL_FILE.FCLOSE(F1);
    /* Free cursor used by the query. */
    CLOSE TCursor;
    END encrypt_to_file;
    /

    OK, so someone has created a directory object for you.
    What do you mean by "I don t get the error with its last condition as procedure"? Are you saying that you no longer get the error when running your procedure?
    Are you looking in C:\Temp on the machine where Oracle is running for the file?
    In the code you posted, you are not writing anything to the file. Can you add a UTL_FILE.PUT (or PUT_LINE) to ensure that there is something in the file?
    Justin

  • Report Painter Help for a Beginner

    Hi All
    I am very new to FI and even SAP - can any one help with the tips for creating a report through Report Painter- I have gone through the online helps but not able to pick up, please help to create a simple G/L Report or some other reports for learning purpose
    Advance thanks for the help
    Thanks again
    Srini

    Hi all
    Please note I have a problem, my client want to create a same cost centers for all company codes (8 company codes) in one controlling area (all company codes linked with one controlling area), but the cost center master data is not accepting the same cost center for the different company code in the same controlling area- client don't want to create a new  cost centers since they are using the same cost centers for years in Peoplesoft, how to tackle this problem- anyway we can suppress the company code in the cost center master data?- &  if we supperss also the final report will be Ok?- Pls help
    Thanks
    Srini

  • Help for a beginner please -using iTunes

    Using iTunes for the first time, I buy and download an item. It`s a piece of music that lasts 55 mins.OK.The stuff comes down the line, and I can make it play on my scratchy screen-speakers.
    I then try to copy it to a DVD with my DVD writer. I`m warned it may take up to an hour. No indication of progress is given. After a few minutes there`s a xylophone-bong. Maybe it means the process failed. Maybe succeeded. I don`t know. No indication of either.The disc won`t play so I suppose I failed.
    A make a second try, on to a CD. This time no Burn - button appears on the screen, so I`m stuck straight away. Is Apple stopping me making a second copy, so I have to spend another ten quid downloading the thing again ? A pretty severe penalty for a mistake !
    Can anyone put me right, and maybe direct me to an elementary tutorial ?
    Eigenblog
    HP T3640 desktop   Windows XP  

    Making a DVD only creates a backup copy of a track. It does not create a disk that can be played in any other player. If you want to create a disk that can be played in other players, you need to burn an audio CD, so check your iTunes -> Advanced -> Burning preference and make sure it's set to Audio CD. Then you need to put the track into a playlist. It can be the only track in the playlist, but it must be in a playlist before it will burn.
    For more information, this tutorial may help:
    iTunes: Burn Your Music To CD
    Hope this helps.

  • A help for a beginner

    i just downloaded JMF on a windowxp OS ( i also downloaded java2sdkl1.4.2_02 ).
    I added the lib and bin directories to the PATH in the systems environment variables and i checked that the jmf.jar and sound.jar are created in the CLASSPATH user environment variables.
    My first question : should i add anything else to my environment variables ?
    i am trying to make an rtp session between two pcs and transmit audio files between the two terminals.
    i followed many methods and all of them failed, but i don't know the reason behind the failure .
    first, i opened an rtp session on the receiver side with the ip address of the transmitter and the port and was waiting for data.
    on the transmitter side , i have chosen an audio file to transmit by the transmit option at the ip address of the receiver and the same port .
    the result was :
    when i tried to transmit an mp3 file, the receiver side have this error :
    Controller error:
    Internal Module com.sun.BasicRendereModule@16aa42e: failed to handle a data format change.
    when i tried to transmit a midi file, the transmitter side have this error :
    Failed to create processor.
    Exception.
    Cannot find a processor for : com.sun.media.protocol.file
    DataSource@57e787
    second method, i transmit the audio file by the transmit option.
    on the receiver side, i opened the URL address : rtp:// 192.168.10.10/40000/audio/1/4
    192.168.10.10 is the ip address of the transmitter side
    40000 the port number same at both sides.
    audio 1 is the number of the track.
    4 is the value of ttl.
    the result is that the receiver opened a player but did not hear anything.
    i also tried the methods described at JMFsolutions : AVReceive2/3, AVTransmit2/3 aslo they failed.
    Last thing, when i try to add a plugin for the codec or renderer or anything else on the registry editor, i receiver the following error:
    Could not add item.
    Hope someone will help me to solve the problems.

    Any one found out the answer ? I get the same damn error ...
    RTP Handler internal error: javax.media.ControllerErrorEvent[s
    a.content.unknown.Handler@19616c7,message=Internal module com.
    dererModule@f0eed6: failed to handle a data format change!]
    thanks in advance for helping me out ...

  • HelP for understanding simple JMS program

    I am trying to compile and run a simple jms requester/server program. The sample code asks to deffine jndi as follow and run wtih jmsadmin
    def qcf(sampleQCF) qmanager(TEST.QMGR) tempmodel(QUEUE.TEMP)
    def q(qSrv) qu(QUEUE.SERVER)
    def q(qReq) qu(QUEUE.REQUESTER)
    Should not a qcf has to have channel and port as a part of defnition? How can this app connect to a queue managger? BTW, my jms provicer is MQ.
    I understand that I have to have a qmgr called TEST.QMGR created and two queues called QUEUE.REQUESTER and QUEUE,SERVER.
    Thanks
    kiran
    Edited by: xmlcrazy on Jan 2, 2010 3:21 PM
    Edited by: xmlcrazy on Jan 2, 2010 4:57 PM

    I was experiencing the same problem. There is probably a mismatch (not the same release) between the ojdbc14.jar and the orai18n.jar. Using http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html I downloaded the latest libraries (10.2.0.3) and moved them to the lib directory of my project. This worked for me.
    Good luck!

  • Help for absolute beginner

    I am very new to computing and wish to learn more. Would like to learn Java and have access to net. Could download from site , but would then need my hand held for installation. If anybody is prepared to get me started please reply. I will not be offended by any answers (especially helpful ones!) Regards Steve

    I am very new to computing and wish to learn more.
    Would like to learn Java and have access to net. Could
    download from site , but would then need my hand held
    for installation. If anybody is prepared to get me
    started please reply. I will not be offended by any
    answers (especially helpful ones!) Regards SteveThis is latest on Sun site. might be helpful
    http://developer.java.sun.com/developer/onlineTraining/new2java/divelog/?frontpage-banner
    cheers!!

  • Printing from ipad - help for a beginner please

    I have downloaded the "Print to All.." app into my ipad 1.  I have an HP Photosmart Premium wireless printer. How do I print an e-mail?

    Have you consulted the Help pages?
    http://mobile.eurosmartz.com/help/help_index.html (assuming that's the correct app).
    However, if it is the correct app, the second line of the description in the AppStore says:
    "if you want to print email, docs, web pages or calendar etc, look at our other app "Print n Share""

  • Some array based help for a beginner needed.

    Hello there.
    I have an array, initialised like..
    int numbers[] = {12, 15, 67, 18, 29, 40, 23, 4, 59, 5 } ;
    and wish to print out a line, which has the sum of these numbers, and the average of them.
    any help will be greatly appreciated.
    Thanks

    So what's the problem?
    How would you do it manually? Write that down in very simple, precise, small steps. Then translate those steps into Java code. Post your best effort and specific questions when you get stuck.

Maybe you are looking for

  • Installed Maverick and now iPhoto wont open, help

    I've just installed Maverick from using Snow Leopard and now iPhoto won't open and the message"You can't open the application "iPhoto" because it is not supported on this type of Mac." appears. Since I have hundreds of photos in iPhoto and iPhoto was

  • Sql Loader - Concurrent request id issue!

    Hello there: I want to load request id in my sql loader script please advice how can I do. Below is my scipt file. LOAD DATA INFILE '${CINT_TOP}/uploads/f_cost/inprocess.dat' BADFILE '/tmp/inprocess.CFL.bad' INTO TABLE cost_temp REPLACE FIELDS TERMIN

  • I can`t open jar files though my java version is updated

    Hello everybody, I`m using Macbook Pro 13` with Lion on it. As it says in the title, I can`t open jar files though, my java version is updated. It says, I shuld check the console. Right now, my java version is, "1.7.0_15", and i`m trying to open a ja

  • Get last 5 records.

    I want to retrieve last 5 records in my emp table. This table contains 1000 rows. i should give "order by sal desc."

  • Export to media with mono audio

    I am working on a project that is using footage that has been recorded to the camera in stereo using both tracks, and in stereo using only the left track. I am a novice with Premier Pro and wondering how to export this project to media with the audio