A little stuck, need help =)

Hey all, Im fairly new here and new to Java as well. I just started college this month and am moving along quite well but I kinda wrote myself into a wall if you will. I just finished writing a program to calculate commission based on some data the user inputs and have just found out that I need to output the total commissions they entered as well as the total value of the sales they entered. Well ive got the program written and now I need to figure out how to squeeze in a list. Ive attached my code so you guys can have a look. Any assistance is very much appreciated and I thank you in advance for any help you can give.
Thanks all,
Halfzipp
Brad.B
P.S. - I apologize if its a bit ugly as again I am a total noob to java.. well.. Ive got about 3 weeks of experience with it so far but thats only 2, 3 hour classes a week.. not enough imo but thats another story.. anyways, i digress, so here ya go.
// imports
import javax.swing.*;
import java.awt.*;
import java.io.*;
import java.util.*;
import java.text.*;
// class
public class JavaAssignment3
     // main method
     public static void main(String[] args)
          //declare variables
          char commissionRateCode, continueCode1;
          double commission;
          double salePrice = 0.0;
          double commissionRate = 0.0;
          String commissionRateCode1; // user must choose either R, M or C
          String salePrice1, commission1, continueCodeString;
          boolean commissionRateCheck = true;
          boolean continueCode = true;
          boolean enterSalePrice = true;
          // create new scanner class to capture keyboard input
          Scanner keyboard = new Scanner(System.in);
          // display program title
          System.out.println("\t\t\t|#| Brad Bass |#|\n");
          System.out.println("\t    |#| Real Estate Commission Calculator |#|\n\n");
          // create while loop to take user back to price
          // input if they wish to calculate more commissions
          while (continueCode == true)
               /** //This is what screwed everything for me..
               //First, not having these 2 variables at all
               //and then Second, putting them here, Lol
               enterSalePrice = true;
               commissionRateCheck = true;
               {//main while loop
               //initiate the variables so the loop will run again
               enterSalePrice = true;
               commissionRateCheck = true;
               //create while loop to check if users input is a positive number
               while (enterSalePrice == true)
                    {//second while loop
                    //tell user to input the sale price
                    System.out.print("Enter the property's selling price: ");
                    //grab sale price from keyboard
                    salePrice1 = keyboard.nextLine();
                    //convert to a double
                    salePrice = Double.parseDouble(salePrice1);
                    //blank space for looks
                    System.out.println();
                    //if the price is zero or negative
                    //tell them to enter a positive number
                    if (salePrice <= 0.0)
                         //tell them to enter a positive number
                         System.out.println("You must enter a positive number.\n");
                    else
                         //if the number is valid continue program
                         enterSalePrice = false;
                    }//second while loop
                    //if they do Not enter the correct code,
                    //ask them to input the code again
                    while (commissionRateCheck == true)
                         {//third while loop
                         //ask user to input commission code and show them the choices
                         System.out.println("\nEnter the property code according to the following:\n\n" +
                                             "\tResidential" + "\t\t" + "enter R\n" +
                                             "\tMulti-Dwelling" + "\t\t" + "enter M\n" +
                                             "\tCommercial" + "\t\t" + "enter C\n");
                         //give the user a spot to enter the code
                         System.out.print("Choose your code: ");
                         //grab code as a string
                         commissionRateCode1 = keyboard.nextLine();
                         //convert to char
                         commissionRateCode = commissionRateCode1.charAt(0);
                         //extra line to keep things looking good
                         System.out.println();
                         // create switch statement to find commission rate
                         switch (commissionRateCode)
                              case 'R':
                              case 'r':
                                   commissionRate = 0.07;
                                   commissionRateCheck = false;
                              break;
                              case 'M':
                              case 'm':
                                   commissionRate = 0.06;
                                   commissionRateCheck = false;
                              break;
                              case 'C':
                              case 'c':
                                   commissionRate = 0.035;
                                   commissionRateCheck = false;
                              break;
                              //tell the user if they enter the wrong code and what the choices are
                              default:
                                   System.out.println("Code must be either - R, M or C!");
                         }//third while loop
                    //calculate commission using calcCommission method
                    commission = calcCommission(salePrice, commissionRate);
                    //format the double so it only displays 2 decimal points
                    String fmt = "0.00#";
                    DecimalFormat df = new DecimalFormat(fmt);
                    String finalCommission = df.format(commission);
                   //output users commission
                   System.out.println("Your commission is $" + finalCommission + "\n");
                   //ask if user would like to enter more commissions
                   System.out.print("More commissions? (y/n): ");
                   //grab thier answer as a string
                   continueCodeString = keyboard.nextLine();
                   //convert to a char
                   continueCode1 = continueCodeString.charAt(0);
                    //extra line to keep it looking good
                   System.out.println();
                   //if customer wants to continue, set continueCode = true,
                   if (continueCode1 == 'y')
                         continueCode = true;
                    //else set continueCode = false and exit the loop
                    else if (continueCode1 == 'n')
                         continueCode = false;
                    }//main while loop
                    //toss program in the garbage.... collector
                    System.gc();
               }//main
     // create second method to calculate commission
     public static double calcCommission(double salePriceA, double commissionRateA)
          // declare variables
          double commission;
          // calculate commission -> commission = salePrice * commissionRate
          commission = (double)salePriceA * (double)commissionRateA;
          // return results
          return commission;
     }//class

paulcw wrote:
The right way would be to create a class called, say, Sale, and Sale would have fields for sale price and commission (and probably other stuff relevant to a sale as well). Before the loop, you could declare a java.util.List of sale objects, like this:
List<Sale> sales = new ArrayList<Sale>();Then in your loop, after you get a sale price and a commission, you'd create a Sale object, and add the object to the list, like this:
sales.add(sale);Then after the main loop finished you could loop through this list, and add up values, etc.
It would also make sense to move stuff like the method that calculates commissions, into the Sale class, but that might not be part of your assignment.Sweet, thanks so much and ya know I definitely should have just read a bit more because just before I read your reply I found ArrayList in the API and added the following to my code:
          //create an array for the salePrice
          ArrayList a = new ArrayList( 100 );
          Collection threadSafeList = Collections.synchronizedCollection( a );
          //create an array for the commissions
          ArrayList b = new ArrayList( 100 );
          Collection threadSafeList2 = Collections.synchronizedCollection( b );right at the top with the other variables and near the bottom, just before i exit the main loop i added:
                    //add elements to the arrays
                    a.add(commission);
                    b.add(salePrice);
                    //test if its working
                    System.out.println(a);
                    System.out.println(b);so that is all working now and I must admit I feel a bit silly for having posted this but then again I guess it did get me to stay up and keep searching hehe.
Now I just need to sum the elements in the arrayList, after the user chooses to end. My concern is, how are these elements being stored in the array? I assume they are getting stored as Strings so if thats the case could I declare the arrayList as an array of doubles? or would I have to parse the data and then add it all.. Or, is there an easy to use method like ArrayList.sum() or something to that affect.. Im searching as I write this but ya never know.
Thanks again for your help.
Take it easy,
Brad.B
EDIT:
Ok so from my reading it seems Im going to need to convert my arrayList to an array and then I can sum the elements. The code would look something like this:
// get array
Object c[] = a.toArray();
double sum = 0.0;
// sum the array
for(double i=0.0; i<c.length; i++)
sum += ((Double) c).doubleValue();
System.out.println("Sum is: " + sum); altho I could be totally wrong.. it is 4 am and I can barely see straight but I cant stop...  I must... get... this ... done... =P
Edited by: halfzipp on Jan 29, 2008 2:05 AM
Edited by: halfzipp on Jan 29, 2008 2:10 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Ink cartridges stuck, need help asap please

    Hello a I am writint this because I need help!! I keep getting a message in error on my Macbook Pro about my Photsmart 6520 is jammed and it says to check to see if any obstructions are bloacking it. Hoever this is like the 20th time that I check inside the printer over and over again. I make sure everything is in order, however when I turn the printer back on it will say the same thing and I keep trying to get it to work, but it won't!!! I just got the printer the day before yesterday and I caanot fix it, please help it is urgent.
    This question was solved.
    View Solution.

    The troubleshooting steps in the document here may help resolve the carriage jam message on your Photosmart 6520 printer.  If the steps there do not resolve the issue I suggest you contact HP support.  If you are in the US or Canada call 1-800-HPINVENt, elsewhere see the contact information here.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • Little problem - needs help

    Since I installed Lion 2 days ago, I am often receiving an error message stating:
    Quote
    There was a problem connecting to the server.
    URLs with the type "file:" are not supported.
    Unquote
    Can anyone please help to fix the problem?
    Thanks in advance.

    I just managed to fix the problem! I went into the Preferences (hold down Apple icon top left of screen and select "System Preferences"), clicked on the "Time Machine" icon (next to last row towards the right), and slid the ON/OFF switch to the OFF position. Like magic...no annoying error message! All I have to do now is remember to turn it back on now and then to back up my laptop.

  • Headless Mac Pro getting stuck - need help with Crash Report

    I have a headless Mac Pro being used as a server. It has recently begun to have problems such as slowing down for a few minutes with apps being slow or non-reponsive. It may serve pages, but the database or FTP may not respond. When logging with VNC (screen sharing) we may get a blank screeen or a screeen with lots of black squares and artifacts. If often clears up, but if fully black will usually require that I log on via SSH and reboot. It may be fine for a day and other days may slow down a few times.
    The only apps are Abyss Web Server, Panorama database, CrushFTP (uses JAVA), and Backuplist+. Temperatures seem to be okay with the highest being the Nortbridge Heat Sink (167 degrees) and a memory module (163 degrees). The primary disks are a few months old and have over 200 GB of free space. I have done maintenance with Applejack, Onyx, and Disk Warrior.
    It finally crashed altogether and I am not experienced at interpreting the reports so here is the crash report in the hopes that someone can help determine the problem:
    Interval Since Last Panic Report:  101039853 sec
    Panics Since Last Report:          1
    Anonymous UUID:                    8DD159F4-CE66-4B72-9F40-E4800A0F5E65
    Sat Sep  7 18:15:27 2013
    panic(cpu 1 caller 0x006376A4): NVRM[0]: Read Error 0x0008804c: BAR0 0xf1000000 0x6fd0b000 0x04b300a2 D0 P0/1
    Backtrace (CPU 1), Frame : Return Address (4 potential args on stack)
    0x5c356158 : 0x12b4c6 (0x45f91c 0x5c35618c 0x13355c 0x0)
    0x5c3561a8 : 0x6376a4 (0x867e80 0x867e80 0x82c6d4 0x0)
    0x5c356208 : 0x67a18c (0x6f91404 0x796f804 0x8804c 0x909def)
    0x5c356248 : 0x8ebf91 (0x796f804 0x8804c 0x4c 0x713455c0)
    0x5c3562a8 : 0x9006da (0x796f804 0x7532004 0x1 0xa)
    0x5c356308 : 0x7390a3 (0x796f804 0x74a0004 0x0 0x0)
    0x5c356348 : 0x67950b (0x74a0004 0x1388 0x0 0x0)
    0x5c356398 : 0x90fa88 (0x796f804 0x5c356488 0x5c356488 0x8)
    0x5c3564c8 : 0x910086 (0x796f804 0x7869604 0x0 0x0)
    0x5c356528 : 0x683736 (0x796f804 0x7869604 0x7a2cb04 0x0)
    0x5c3565a8 : 0x644c49 (0xc1d00041 0xbeef0003 0xbeef0202 0x6b0a100)
    0x5c3565e8 : 0x635804 (0x5c356778 0x6 0x0 0x0)
    0x5c356748 : 0x62736c (0x0 0x600d600d 0x7058 0x5c356778)
    0x5c356808 : 0xe8f917 (0xc1d00041 0xbeef0003 0xbeef0202 0x6b0a100)
    0x5c356848 : 0xe8f9ee (0x46873000 0x6b0a100 0xcac000 0x0)
    0x5c356878 : 0xe4ff9f (0x46873000 0x6b0a100 0xcac000 0x0)
              Backtrace continues...
          Kernel loadable modules in backtrace (with dependencies):
             com.apple.GeForce(5.4.8)@0xe3c000->0xed3fff
                dependency: com.apple.NVDAResman(5.4.8)@0x61e000
                dependency: com.apple.iokit.IONDRVSupport(1.7.3)@0x610000
                dependency: com.apple.iokit.IOPCIFamily(2.6)@0x5e2000
                dependency: com.apple.iokit.IOGraphicsFamily(1.7.3)@0x5f3000
             com.apple.nvidia.nv40hal(5.4.8)@0x87d000->0xa47fff
                dependency: com.apple.NVDAResman(5.4.8)@0x61e000
             com.apple.NVDAResman(5.4.8)@0x61e000->0x87cfff
                dependency: com.apple.iokit.IONDRVSupport(1.7.3)@0x610000
                dependency: com.apple.iokit.IOPCIFamily(2.6)@0x5e2000
                dependency: com.apple.iokit.IOGraphicsFamily(1.7.3)@0x5f3000
    BSD process name corresponding to current thread: AppleVNCServer
    Mac OS version:
    9L31a
    Kernel version:
    Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386
    System model name: MacPro1,1 (Mac-F4208DC8)
    System uptime in nanoseconds: 65137051142183
    unloaded kexts:
    com.apple.driver.AppleHDAPlatformDriver          1.7.1a2 - last unloaded 131738816746
    loaded kexts:
    com.bresink.driver.BRESINKx86Monitoring          9.0 - last loaded 71732761724
    com.apple.driver.AppleHWSensor          1.9d0
    com.apple.filesystems.autofs          2.0.2
    com.apple.driver.AppleHDAPlatformDriver          1.7.1a2
    com.apple.driver.AppleUpstreamUserClient          2.7.5
    com.apple.driver.AppleHDAHardwareConfigDriver          1.7.1a2
    com.apple.driver.AppleHDA          1.7.1a2
    com.apple.GeForce          5.4.8
    com.apple.driver.AppleHDAController          1.7.1a2
    com.apple.Dont_Steal_Mac_OS_X          6.0.3
    com.apple.iokit.IOFireWireIP          1.7.7
    com.apple.driver.AudioIPCDriver          1.0.6
    com.apple.nvidia.nv40hal          5.4.8
    com.apple.driver.AppleMCEDriver          1.1.7
    com.apple.driver.ACPI_SMC_PlatformPlugin          3.4.0a17
    com.apple.driver.AppleLPC          1.3.1
    com.apple.driver.AppleTyMCEDriver          1.0.0d28
    com.apple.driver.MaxTranserSizeOverrideDriver          2.0.9
    com.apple.driver.iTunesPhoneDriver          1.0
    com.apple.iokit.IOUSBMassStorageClass          2.0.8
    com.apple.driver.AppleUSBComposite          3.2.0
    com.apple.driver.PioneerSuperDrive          2.0.9
    com.apple.iokit.SCSITaskUserClient          2.1.1
    com.apple.driver.AppleRAID          3.0.19
    com.apple.driver.XsanFilter          2.7.91
    com.apple.iokit.IOATAPIProtocolTransport          1.5.3
    com.apple.iokit.IOAHCIBlockStorage          1.2.2
    com.apple.driver.AppleFileSystemDriver          1.1.0
    com.apple.driver.AppleUSBHub          3.4.9
    com.apple.iokit.IOUSBUserClient          3.5.2
    com.apple.driver.AppleAHCIPort          1.7.0
    com.apple.driver.AppleFWOHCI          3.9.7
    com.apple.driver.AppleIntelPIIXATA          2.0.1
    com.apple.driver.AppleIntel8254XEthernet          2.1.2b1
    com.apple.driver.AppleUSBEHCI          3.4.6
    com.apple.driver.AppleUSBUHCI          3.5.2
    com.apple.driver.AppleEFINVRAM          1.2.0
    com.apple.driver.AppleACPIButtons          1.2.5
    com.apple.driver.AppleRTC          1.2.3
    com.apple.driver.AppleHPET          1.4
    com.apple.driver.AppleACPIPCI          1.2.5
    com.apple.driver.AppleSMBIOS          1.4
    com.apple.driver.AppleACPIEC          1.2.5
    com.apple.driver.AppleAPIC          1.4
    com.apple.security.seatbelt          107.12
    com.apple.nke.applicationfirewall          1.8.77
    com.apple.security.TMSafetyNet          3
    com.apple.driver.AppleIntelCPUPowerManagement          76.2.0
    com.apple.driver.DiskImages          199
    com.apple.BootCache          30.4
    com.apple.driver.DspFuncLib          1.7.1a2
    com.apple.iokit.IOHDAFamily          1.7.1a2
    com.apple.iokit.IOAudioFamily          1.6.9fc5
    com.apple.kext.OSvKernDSPLib          1.1
    com.apple.NVDAResman          5.4.8
    com.apple.iokit.IONDRVSupport          1.7.3
    com.apple.iokit.IOGraphicsFamily          1.7.3
    com.apple.driver.IOPlatformPluginFamily          3.4.0a17
    com.apple.driver.AppleSMC          2.3.1d1
    com.apple.iokit.IOSCSIMultimediaCommandsDevice          2.1.1
    com.apple.iokit.IOSCSIBlockCommandsDevice          2.1.1
    com.apple.iokit.IOBDStorageFamily          1.5
    com.apple.iokit.IODVDStorageFamily          1.5
    com.apple.iokit.IOCDStorageFamily          1.5
    com.apple.iokit.IOSCSIArchitectureModelFamily          2.1.1
    com.apple.iokit.IOAHCIFamily          1.5.0
    com.apple.iokit.IOFireWireFamily          3.4.9
    com.apple.iokit.IOATAFamily          2.0.1
    com.apple.iokit.IONetworkingFamily          1.6.1
    com.apple.iokit.IOUSBFamily          3.5.2
    com.apple.driver.AppleEFIRuntime          1.2.0
    com.apple.iokit.IOSMBusFamily          1.1
    com.apple.iokit.IOHIDFamily          1.5.5
    com.apple.iokit.IOStorageFamily          1.5.6
    com.apple.driver.AppleACPIPlatform          1.2.5
    com.apple.iokit.IOPCIFamily          2.6
    com.apple.iokit.IOACPIFamily          1.2.0

    THIS:
    panic(cpu 1 caller 0x006376A4): NVRM[0]: Read Error
    ... Correlates with NVIDIA graphics card failure OR the use of two NVIDIA cards simultaneously in the same Mac Pro in 10.8 and later.
    The Apple-firmware 5770, about US$250,  works in every model Mac Pro, and drivers are in 10.6.5 and later.
    If you decide to do a Conversion of your Server from 10.5 to 10.6, it is not too bad. Just plan on a brief downtime -- I tried to keep it all running 24/7 by creating a new Servername for the new one, and that serious mistake still haunts me.
    You should plan on such a conversion to get closer to current security updates -- 10.5 is not getting those updates, and you should really disconnect your 10.5 Server from the Internet.

  • K320 Rescue and Recovery Stuck, need help!!!

    Hi everybody!!!
    My K320 has stuck when i tried to recovery the system. It show the command line window during the process. But nothing then happen.
    Link to picture
    Thanks in advance for any suggestion!!!
    Moderator note; picture(s) totalling >50K converted to link(s) Forum Rules

    Thanks ortegaluis for your reply.
    First time i start the rescue and recovery i though it perform some task, then i leave it run and go to sleep (about 7 hours), when i wake up... there is nothing change, still that screen with the command line window.
    @ ortegaluis: i did as you said then the computer restart and nothing change. Can you give me another suggestion?
    I tried to install new windows by ISO file i downloaded from this link :http://msft-dnl.digitalrivercontent.net/msvista/pub/X15-65733/X15-65733.iso . The setup was smooth but i could not active windows with the product key printed on the computer label. Can someone show me how to active windows with the product key printed on the body computer?

  • I had a little accident need help!!!!

    ok i was in the bathroom, and my ipod classic fell out of my pocket, bounced of the rim of the tiolet and fell in, I immediatley took it out rinsed it off, just the front and back, not near plug-ins. It wasn't on but when it fell in the screen came on and was frozen for about 5-10 min, then it went black. It was clicking a bit every once in awhile too, which it usually did when i would reset it. Ive used the blow dryer on it but it still wont come on, no matter what buttons i press, is it completely fried? will i have to buy a new one? can it be fixed/replaced?

    The only mistakes you've made so far are:
    1. Dropping it in the toilet
    2. Rinsing it off (Electronics don't like water...so why expose it to more water?)
    3. Using the blow dryer on it (this drove the water even further in the device where it could do more damage).
    You could set it in a cool, dry place for about 5 - 7 days to let it thoroughly dry, then connect it to power for at least 30 minutes (a wall charger works best for this) and then Reset it while it is still connected to power. It may take several tries. If it revives, fully charge it and then Restore it in iTunes.
    If it does not come back to life you could send it to http://www.iresq.com and for $9 they will tell you how much damage you did and give you a cost to repair it. Then you can decide whether to do so or just buy a new one.

  • Little bit of help with the duplication process needed

    Hi
    I trying to duplicate a database from one server to a remote server. They are both running windows server 2003 (my first problem) , the primary server is running oracle 11gR1 and the (hopefully) receiving server is running 11gR2(is that going to be a problem?) and I'm a little stuck on some parts of the process.
    The book I'm using says to edit the listener.ora file to include a SID_DESC of the remote database. Here is my listener.ora file with the modifications
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = test.host.local)(PORT = 1521))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = CGARDMSTR)
    (ORACLE_HOME = G:\app\administrator\product\11.1.0\db_1)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = CGARDMSTR)
    (ORACLE_HOME =G:\app\administrator\product\11.1.0\db_1)
    (SID_NAME = CGARDMSTR)
    *(SID_DESC* *=*
    *(GLOBAL_DBNAME* *=* cgard)
    *(ORACLE_HOME* *=F:\oracle\product\11.2.0\dbhome_1)*
    *(SID_NAME* *=* cgard)
    (bold is what i added)
    it then said to chnage my tnsnames.ora
    CGARD =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = test.host.local)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = cgard)
    CGARD5DE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = test.host.local)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = CGARD5DEV)
    CGARDMST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = test.host.local)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = CGARDMSTR)
    cgard =
    *(DESCRIPTION =*
    *(ADDRESS = (PROTOCOL = TCP)(HOST = live.host.local)(PORT = 1521))*
    *(CONNECT_DATA =*
    *(SERVER = DEDICATED)*
    *(SERVICE_NAME = cgard)*
    I changed the local domain to host for business reasons
    The next step was to create a initialization parameter file which I am guessing is a pfile and hopefully not a spfile. It then says to only enter one param db_name and the conversion params if the filesystem is diffrent. Problem is I don't know what to do with this file, if I am suppose to switch the second database to this file then surly I would need some more params? Anyway thats the first of many questions.
    When I try to run through the rman commands it describes it also trips up:
    RMAN> connect auxiliary sys/*********@live.host.local
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-04006: error from auxiliary database: ORA-12170: TNS:Connect timeout occurr
    ed
    The other database is up and connectable via sqldevloper so I'm guessing it was my configuration of listener and tnsnames
    Ok to reiterate my questions are:
    1) what needs to be in the pfile I create for the database thats going to receive the backup and what do I do with that file when I have made it?
    2) I am pretty sure my listener and tsunamis config is completely wrong so can I have some pointers on fixing that?
    3) Was the reason I could not connect to the receiving database my tns and listener config or is it something else?
    Quite a few other questions but untill I know some more about the above I doubt I will be able to ask properly.
    Also if this helps the book I am using is Expert Oracle Database 11g Administration and the page is 835(the method that begins on that page) and I am willing to write out the whole method if you need more details.
    Oh and if you havent figured it out I am very new to this so if some of this sounds very wrong or just stupid just say what I need to change and I will get right on it.
    Thanks
    Alex

    Ok so I have made some progress. Here is where I am currently at:
    RMAN> RUN
    2> {
    3> SET NEWNAME FOR DATAFILE 1 TO 'F:\oracle\oradata\cgard\file1.dbs';
    4> SET NEWNAME FOR DATAFILE 2 TO 'F:\oracle\oradata\cgard\file2.dbs';
    5> SET NEWNAME FOR DATAFILE 3 TO 'F:\oracle\oradata\cgard\file3.dbs';
    6> SET NEWNAME FOR DATAFILE 4 TO 'F:\oracle\oradata\cgard\file4.dbs';
    7> SET NEWNAME FOR DATAFILE 5 TO 'F:\oracle\oradata\cgard\file5.dbs';
    8> SET NEWNAME FOR TEMPFILE 1 TO 'F:\oracle\oradata\cgard\temp1.dbs';
    9> duplicate target database
    10> to cgard
    11> from active database
    12> pfile='F:\oracle\product\11.2.0\dbhome_1\database\initCGARD.ora';
    13> }
    executing command: SET NEWNAME
    starting full resync of recovery catalog
    full resync complete
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    Starting Duplicate Db at 19-NOV-10
    using channel ORA_AUX_DISK_1
    contents of Memory Script:
    set newname for datafile 1 to
    "F:\ORACLE\ORADATA\CGARD\FILE1.DBS";;
    set newname for datafile 2 to
    "F:\ORACLE\ORADATA\CGARD\FILE2.DBS";;
    set newname for datafile 3 to
    "F:\ORACLE\ORADATA\CGARD\FILE3.DBS";;
    set newname for datafile 4 to
    "F:\ORACLE\ORADATA\CGARD\FILE4.DBS";;
    set newname for datafile 5 to
    "F:\ORACLE\ORADATA\CGARD\FILE5.DBS";;
    backup as copy reuse
    datafile 1 auxiliary format
    "F:\ORACLE\ORADATA\CGARD\FILE1.DBS"; datafile
    2 auxiliary format
    "F:\ORACLE\ORADATA\CGARD\FILE2.DBS"; datafile
    3 auxiliary format
    "F:\ORACLE\ORADATA\CGARD\FILE3.DBS"; datafile
    4 auxiliary format
    "F:\ORACLE\ORADATA\CGARD\FILE4.DBS"; datafile
    5 auxiliary format
    "F:\ORACLE\ORADATA\CGARD\FILE5.DBS"; ;
    sql 'alter system archive log current';
    executing Memory Script
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    executing command: SET NEWNAME
    Starting backup at 19-NOV-10
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=143 device type=DISK
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00001 name=G:\APP\ADMINISTRATOR\ORADATA\CGARDMSTR\SYS
    TEM01.DBF
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/19/2010 16:23:
    52
    ORA-17629: Cannot connect to the remote database server
    ORA-17627: ORA-01017: invalid username/password; logon denied
    ORA-17629: Cannot connect to the remote database server
    continuing other job steps, job failed will not be re-run
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00004 name=G:\APP\ADMINISTRATOR\ORADATA\CGARDMSTR\USE
    RS01.DBF
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/19/2010 16:24:
    24
    ORA-17629: Cannot connect to the remote database server
    ORA-17627: ORA-01017: invalid username/password; logon denied
    ORA-17629: Cannot connect to the remote database server
    continuing other job steps, job failed will not be re-run
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00002 name=G:\APP\ADMINISTRATOR\ORADATA\CGARDMSTR\SYS
    AUX01.DBF
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/19/2010 16:24:
    43
    ORA-17629: Cannot connect to the remote database server
    ORA-17627: ORA-01017: invalid username/password; logon denied
    ORA-17629: Cannot connect to the remote database server
    continuing other job steps, job failed will not be re-run
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00003 name=G:\APP\ADMINISTRATOR\ORADATA\CGARDMSTR\UND
    OTBS01.DBF
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/19/2010 16:25:
    17
    ORA-17629: Cannot connect to the remote database server
    ORA-17627: ORA-01017: invalid username/password; logon denied
    ORA-17629: Cannot connect to the remote database server
    continuing other job steps, job failed will not be re-run
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00005 name=G:\APP\ADMINISTRATOR\ORADATA\CGARDMSTR\RMA
    N01.DBF
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 11/19/2010 16:25:55
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/19/2010 16:25:
    55
    ORA-17629: Cannot connect to the remote database server
    ORA-17627: ORA-01017: invalid username/password; logon denied
    ORA-17629: Cannot connect to the remote database server
    RMAN>
    I did issue the commands:
    C:\Documents and Settings\Administrator>rman target /
    Recovery Manager: Release 11.1.0.6.0 - Production on Fri Nov 19 13:55:40 2010
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    connected to target database: CGARDMST (DBID=3160500813)
    RMAN> connect catalog rman/rman
    connected to recovery catalog database
    RMAN> connect auxiliary sys/**********@cgard
    connected to auxiliary database: CGARD (not mounted)
    So I am not quite sure what it wants. I read somewhere about a password file but I don't understand how it will help, also most things I have looked at wernt clear on how to do it. I took a stab anyway:
    G:\app\administrator\product\11.1.0\db_1\BIN>orapwd file=orapwcgard password=*********** entries=20 ignorecase=n
    Was run on the original database host.
    File was then copied to "F:\oracle\product\11.2.0\dbhome_1\database" on the receiving database's host it was then renamed to PWDcgard.ora as there was file there already with that name.
    It did not help(same error).
    The book I am using mentions the 'PASSWORD FILE' param to be used with the duplicate command but I cant find a example on how to use it so any help with that would be great.
    Thanks for the effort so far guys its really appreciated.

  • I need help. My ipad 2 was stuck in recovery mode. i tried to connect it to itunes and restore but after downloading the file and extracting the software there is a pop up message that says "the device is full" i dont know what to do. Its been 2 days now.

    I need help. My ipad 2 was stuck in recovery mode. i tried to connect it to itunes and restore but after downloading the file and extracting the software there is a pop up message that says "the device is full. Deleting files and emptying your recycle been will help you restore." how am i going to erase files if i can't open my ipad. i dont know what to do. Its been 2 days now. please help. thanks.

    yes i am sure. This are the exact words... "The iPad "iPad" could not be restored. The disk you are attempting to use is full. (Removing files and emptying the recycle bin will free up additional space". i tried some options, hard reset, redsnow, tinyumbrella but still it's stuck.

  • I need help my ipod touch 4g wont show up on my computer and it is stuck in recovery mode

    i need help with my ipod touch 4g its stuck on recovery mode and it wont show up on my computer its been 4 months and its still like that what can i doo to fix that email me at [email protected] or post on here

    - Try here to get iTunes to see the iPod:
    iPhone, iPad, or iPod touch: Device not recognized in iTunes for Windows
    iPhone, iPad, iPod touch: Device not recognized in iTunes for Mac OS X
    - Yu can also try another computer to help determine if you have a computer or iPod problem
    - Try manually placing the iPod in recovery mode. For that see:
    iPhone and iPod touch: Unable to update or restore
    - Try DFU mode:
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings

  • My ipod touch (2nd generation) is stuck on the usb to itunes screen.  I have NOT jailbroken it, and i have alsop tried restarting numerous times. I need help, soon!

    My ipod touch (2nd generation) is stuck on the usb to itunes screen.  I have NOT jailbroken it, and i have also tried restarting numerous times. I need help, soon! Itunes on my computer works about 50% of the time, so i feel lost!

    Download RecBoot and see if you can kick it out of recovery mode.
    Basic troubleshooting steps. 
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G + 120G OCZ Vertex 3 SSD Boot HD 

  • The product that I purchased is not working!!!! I need help and I've been stuck in your "Contact us loop" for the last few days and I'm getting frustrated. How do I contact you for HELP!

    The product that I purchased is not working!!!! I need help and I've been stuck in your "Contact us loop" for the last few days and I'm getting frustrated. How do I contact you for HELP!

    Probably the best place to start is the right forum for your product. This is the forum for Distiller Server, a long dead product used by big companies, and probably not what you have. If you can't find the right forum, please let us know the FULL name of what you paid for (please check your invoice, as Adobe have many similar products), and we can perhaps direct you. Good luck!

  • I need help my computer isn't working and there is no was to get on my iTunes and I just updated my phone and now it's stuck on where it shows the plug connected to iTunes help!!!!

    I need help my computer isn't working and there is no was to get on my iTunes and I just updated my phone and now it's stuck on where it shows the plug connected to iTunes help!!!!

    There is no other way than to plug into a computer to restore the phone. You can use another computer to do so, but in case you did not back up to iCloud your data and settings will be gone.
    Follow this article to connect in recovery mode:
    iOS: Unable to update or restore

  • HT4208 I just need a little bit of help. I visited the american ap store looking for the new scrabble game which is not available in the australian ap store. Can't get it anyway as I don't have an account there. I am trying to get back to the australian a

    I just need a little bit of help. I visited the american ap store, using my i phone, to check out something. I dont have an account with them so I couldn't get what I wanted anyway.Now, I need to get back to the australian store and I don't know how to do that. Please help!

    Go to app store- scroll down to bottom- click on apple id- change country

  • My phone (5C) is stuck in the restore mode which is preventing a backup which is preventing installation of IOS 8.1. Need help.

    My phone (5C) is stuck in the restore mode which is preventing a backup which is preventing installation of IOS 8.1. Need help.

    Hi Petesmith643,
    Welcome to the Apple Support Communities!
    It sounds like your device is in recovery mode. I understand you would like to back it up before updating to iOS 8.1 but cannot because you are in recovery mode. I would first suggest restarting your device to exit recovery mode. 
    If you can't update or restore your iPhone, iPad, or iPod touch
    If you put your device into recovery mode by mistake, restart it. Or you can wait 15 minutes and your device will exit recovery mode by itself.
    Cheers,
    Joe

  • Need Help: BBZ10 Stuck on Usb Moniter Screen Unable to Boot / Start

    Hi,
    I recently purchased a Balckberry Z10, while trying to transfer my data from my existing blackberry I accidently reset my device to factory setting. now it is stuck on the usb moniter screen.
    I  have tried reloading the phone using Link but it keeps on showing me a message: Unable to reload due to error: No Update Available.
    I am using a Mac.
    Need Help!

    So this is the problem and the resolution is this.. But unfortunately it is not working because I keep on getting this message that no update available.

Maybe you are looking for

  • SBS 2008 Shares

    Hi, Got an intermittent problem with SBS2008 shares being accessed from Mac 10.6.3 workstations. A lot of the time everything is ok but occasionally (with no real pattern) it will take upwards of 30 seconds to open a folder up and my clients are gett

  • 4.0.3 Version 5a (DON'T DO IT!)

    22 Dec 12 UPDATE: Sony Tier-2 sent me a link to download a flash file. I'm going to be trying that out today. one other issue popping up is apps dissapear from the screens. Seems to happen ramdomly. 23 Dec 12 Wish they would have just sent me the ima

  • How to know threads status

    Hello all! I want to know if all my threads are done. I wrote some code but when I run it have this errors: Exception in thread "AWT-EventQueue-0" java.lang.IllegalMonitorStateException         at java.lang.Object.wait(Native Method)         at java.

  • RAW conversion really is sad.

    OK, So there a some bugs. Maybe it's not as "blazing" fast as it could be. But the RAW conversion just *****. I shoot 1Ds and sure the conversions look good at full screen, even on my 30 incher. They would make some fine 4x5 prints. Trouble is the fo

  • Why is safari 5.1.2 not showing up in software updates?

    I am running Lion server and the Safari 5.1.2 update isn't there. Any ideas?