Java Newbie needs help with multi method dialog calculator

Our example for the unit was the example below... we now must create a 5 method program for a calculator... 1 main method and 4 for the standard operations(+ - * /). It is supposed to utilize Swing for graphics/dialog boxes that ask you for the operation you would like to use(if statements based on which operation they enter), and a prompt that asks you separately for the 2 numbers used.... anyone feel like drawing this skeleton out? I am in class right now and none of my neighbors can figure it out either....
import javax.swing.JOptionPane;
public class Payroll
     public static void main(String[] args)
     String name;         //the user's name
     String inputString;  //holds input
     int hours;           //hours worked
     double payRate;      //hourly pay wage
     double grossPay;     //total pay
     //getUser
     name = JOptionPane.showInputDialog("What is your name?");
     //getHours
     inputString = JOptionPane.showInputDialog("How many hours did you work?");
     hours = Integer.parseInt(inputString);
     //getRate
     inputString = JOptionPane.showInputDialog("What is your hourly pay rate?");
     payRate = Double.parseDouble(inputString);
     //setGross
     grossPay = payRate * hours;
     //showGross
     JOptionPane.showMessageDialog(null, "Hello " + name + ". Your gross pay is: " + grossPay); 
     //End
     System.exit(0);
}

import javax.swing.JOptionPane;
public class CalcDiag
     public static void main(String[] args)
     String operation;
     String inputString;
     double num1, num2, total=0;
     inputString = JOptionPane.showInputDialog("What is your first number?");
     num1 = Double.parseDouble(inputString);
     inputString = JOptionPane.showInputDialog("What is your second number?");
     num2 = Double.parseDouble(inputString);
     inputString = JOptionPane.showInputDialog("Please indicate which operation you would like to use: A,S,M,D ?");
     operation = inputString;
     if (operation.equals("A"))
          total = getAdd(num1, num2);
     if (operation.equals("S"))
          total = getSub(num1, num2);
     if (operation.equals("M"))
          total = getMult(num1, num2);
     if (operation.equals("D"))
          total = getDiv(num1, num2);
     JOptionPane.showMessageDialog(null,"Total = "+total);
     System.exit(0);
public static double getAdd(double x, double y)
          return x+y;
public static double getSub(double x,double y)
          return x-y;
public static double getMult(double x, double y)
          return x*y;
public static double getDiv(double x, double y)
          return x/y;
}your welcome

Similar Messages

  • Need help with Sound Methods

    Hi, I am new to java and need help with sound methods.
    q: create a new method that will halve the volume of the positive values and double the volume of the negative values.
    Message was edited by:
    Apaula30

    duplicate message #2

  • Need help with calling method

    I'm new to Java, trying to pass a required class so I can graduate this semester, and I need help figuring out what is wrong with the code below. My assignment is to create a program to convert celsius to fahrenheit and vice versa using Scanner for input. The program must contain 3 methods - main, convert F to C, method, and convert C to F method. Requirements of the conversion methods are one parameter which is an int representing temp, return an int representing calculated temp after doing appropriate calculation, should not display info to user, and should not take in info from user.
    The main method is required to ask the user to input a 1 for converting F to C, 2 for C to F, and 3 to end the program. It must include a while loop that loops until the user enters a 3, ask the user to enter a temp, call the appropriate method to do the conversion, and display the results. I'm having trouble calling the conversion methods and keep getting the following 2 compiler errors:
    cannot find symbol
    symbol : method farenheitToCelsius(int)
    location: class WondaPavoneTempConverter
    int celsius = farenheitToCelsius(intTemp);
    ^
    cannot find symbol
    symbol : method celsiusToFarenheit(int)
    location: class WondaPavoneTempConverter
    int farenheit = celsiusToFarenheit(intTemp);
    The code is as follows:
    public static void main(String[] args) {
    // Create a scanner
    Scanner scanner = new Scanner(System.in);
    // Prompt the user to enter a temperature
    System.out.println("Enter the temperature you wish to convert as a whole number: ");
    int intTemp = scanner.nextInt();
    System.out.println("You entered " + intTemp + " degrees.");
    // Prompt the user to enter "1" to convert to Celsius, "2" to convert to
    // Farenheit, or "3" to exit the program
    System.out.println("Enter 1 to convert to Celsius, 2 to convert to Farenheit, or 3 to exit.");
    int intConvert = scanner.nextInt();
    // Convert temperature to Celsius or Farenheit
    int celsius = farenheitToCelsius(intTemp);
    int farenheit = celsiusToFarenheit(intTemp);
    while (intConvert >= 0) {
    // Convert to Celsius
    if (intConvert == 1) {
    System.out.println("Celsius is " + celsius + " degrees.");
    // Convert to Farenheit
    else if (intConvert == 2) {
    System.out.println("Farenheit is " + farenheit + " degrees.");
    // Exit program
    else if (intConvert == 3) {
    break;
    else {
    System.out.println("The number you entered is invalid. Please enter 1, 2, or 3.");
    //Method to convert Celsius to Farenheit
    public static int celsiusToFahrenheit(int cTemp) {
    return (9 / 5) * (cTemp + 32);
    //Method to convert Farenheit to Celsius
    public static int fahrenheitToCelsius(int fTemp) {
    return (5 / 9) * (fTemp - 32);
    I readily admit I'm a complete dunce when it comes to programming - digital media is my area of expertise. Can anyone point me in the right direction? This assignment is due very soon. Thanks.

    1) consider using a boolean variable in the while statement and converting it to true if the input is good.
    while (inputNotValid)
    }2) put the code to get the input within the while loop. Try your code right now and enter the number 30 when your menu requests for input and you'll see the infinite loop.... and why you need to request input within the loop.
    3) Fix your equations. You are gonig to have to do some double calcs, even if you convert it back to int for the method return. Otherwise the results are just plain wrong. As a good test, put in the numbers -40, 0, 32, 100, and 212. Are the results as expected? (-40 is the only temp that is the same for both cent and fahr). I recommend doing double calcs and then casting the result to int in the return. for example:
    int a = (int) (20 + 42.0 / 3);  // the 42.0 forces the compiler to do double calc.4) One of your equations may still be plain wrong even with this fix. Again, run the test numbers and see.
    5) Also, when posting your code, please use code tags so that your code will be well-formatted and readable. To do this, either use the "code" button at the top of the forum Message editor or place the tag [code] at the top of your block of code and the tag [/code] at the bottom, like so:
    [code]
      // your code block goes here.
    [/code]

  • Need help with "get info" dialog box

    Hi Everyone!
    I need some help with trying to figure out what some of the options are in the "Get Info" dialog box. I've searched the iTunes help and these forums, but can't find anything.
    So, in the options tab,
    1. What does "Part of compilation" Y/N, do for me?
    2. Same for "Remember Position"
    3. And finally, "Gapless album"
    Thanks, Vince.

    1. when you import a compilation album (like an 80's compilation or something), itunes will import it as
    song 1, artist 1, 80's greatest hits
    song 2, artist 2, 80's greatest hits etc
    Click part of a compliation means that, it means that it would keep them altogether rather than having lots of songs everywhere
    2. If you start playing a song, then stop, part way through, when you next come to the song, itunes will remember where you left off
    3. Albums like jean michel jarre, classical, mike oldfield, etc, have many songs which merge into each other. Having gapless album ticked will ensure that, when playing the album, there are no gaps between songs

  • Newbie needs help with Flex app

    Hi there. I am very new to Flex and also fairly new to
    programming although I do have a little experience.
    I am trying to create an app which stores code snippets or
    common text I tend to use every day in my documents and emails.
    So basically I need help on a design level. I can refer to
    the developer's manual for exact instructions for commands, but I
    need to know what to code first.
    The app will consist of:
    -a tree directory structure where I can create groups.
    -There will be a basic text editor where I input all my data,
    basic text formatting options (font, bullets etc) would be a bonus.
    -A search function
    -Finally it will ideally allow multiple client apps write to
    a central database file over a network
    Can anyone suggest how I should approach such a project?
    Or are there any tutorials / source files which demonstrate
    each bullet point?
    thanks.

    Hey jono,
    I'm new too. But I think I might know the right components.
    If you google any of these + flex 3 you should get some
    decent documentation
    tree - advanced dataGrid component
    basic text editor - rich text editor component
    search function - well, you're gonna need to read up on
    arrays, and arraycollection. Once you get that stuff working, you
    can write up a function to search for a string in an array.
    network functionality - HTTPService, you can dump the
    datagrid into a database, and have it load the database when you
    open up the application.
    Give these things a shot, tutorials / sources will come with
    the google searches.

  • Newbie needs help with browser compatibility

    Ok, so I'm new at this, so this may be something really
    simple, but browser compatibility? I made a site in DW;html and it
    shows up perfect in safari but internet explorer and firefox not so
    much. I did a browser compatibility test in DW and it says nothing
    is wrong with my pages, but obviously something must be!!
    On my home page, the image of a house that I have next to the
    company name shows up fine in safari but not any other browsers.
    And my page layout, everything is moved over funny in other
    browsers. Also there are link boxes around the table I created with
    different brands of products. On safari the boxes do not show, but
    all the other browsers it does!! I'm new at this and frustrated!!!
    Need help!!
    The link is holmeshifi.com and I posted code from the home
    page!

    OK thanks Ned sorry to soo dumb I'm on a learning curve here!  what 
    I'm trying to do is go to the URLs of web galleries of images from my 
    main site
    so I would presumably have to rename them on my server? i.e. does that 
    mean adding the code ", "_blank");
    to the files on the server?
    At the moment I have to use the back button on my browser window which
    takes me back to the main site which then has to reload (tediously!)

  • MSI P67A-C45 (B3) Newb needs Help with connections..

    Hi all..
    First time posting here, but have been in the shadows for quite a while..   
    Anyway, i decided to finally take the plunge, and build my own PC, and now i'm beginning to hit a few bumps.
    I have a couple of questions that i would like some help with, if possible to reassure myself i may be in the right direction..
    I bought THIS PSU and was hoping someone could tell me where the Blue connectors (one labelled CP and one labelled U1) Connect to?
    Is it into JPWR2? And does it/do they only connect in the correct way? (Do i remove the plastic cap and attach both?
    and i bought THIS VIDEO/GRAPHICS CARD and i'm guessing the RED "PCI express" and "SLI ready" connect to that somehow (Haven't opened box yet for card)
    Again, wondering is there a certain way for them to connect.
    Also, from my chassis, the "AC '97" and "HDA" connectors go to JAUD (I guess), does it matter which one? (I currently have "HDA" connected)
    I have i5 2500k already on board. (If that makes a difference).

    Quote from: Ben_Cartwright on 26-May-11, 22:05:35
    Do the Audio plugs go into JAUD? and does it matter which one?
    Yep, connect the front panel audio to the JAUD. If you need the pin layout, it says in the manual. I would say the HDA connector is the one to connect.
    Quote from: Ben_Cartwright on 26-May-11, 22:05:35
    Any recommendations for testing it all, before i plug it in, and press the power?
    Should i (Can i) test individual parts first?
    Thanks again.
    Check all power connections, seating of the RAM and add-on cards, check the HSF is plugged into the fan header, and obvious things like that.
    As for testing, enter the BIOS and make sure the CPU isn't running too hot. Set up the RAM with the required timings and voltage, and test with >>Memtest86<< for several hours. No point starting the Windows installation if say your RAM has errors, since it will corrupt files during the install, if it installs at all.

  • I am a beginner in Labview and need help with multi-device synchronization.

    I am using a VI I found in order to continuously acquire and write voltage.  The next phase is to somehow synchronize this with a linear platform and am wondering if there are any tutorials on how to do this out there, or if anyone could give just general advice.  I'm not necessarily asking for explicit details on the code but rather where I would be able to improve my skills in a way that would help with this project.  Thank you in advance.

    Hi riraheta,
    Are you using daq? Can you tell me more about this linear platform which you want to synchronize? What operation do you plan to synchronize?
    There are some examples online which has to do in synchronizing devices, depends on what you're planning to synchronize. The following are the few I have found.
    Links (Presuming that you're using DAQ devices):
    Synchronize Continuous Acquisition of Multiple Analog Devices (login required)
    https://decibel.ni.com/content/docs/DOC-12182
    Easily Synchronize Your Measurements in LabVIEW 2010
    http://www.ni.com/white-paper/11549/en/
    Application Design Patterns: Producer/Consumer
    http://www.ni.com/white-paper/3023/en/
    Application Design Patterns: Master/Slave
    http://www.ni.com/white-paper/3022/en/
    Timing and Synchronization Features of NI-DAQmx
    http://www.ni.com/white-paper/4322/en/
    Or you can search it from your NI Example Finder (Open LabVIEW >> Help >> Find Examples... >> Type in the keyword of your interests)
    Hope it helps
    Warmest regards,
    Lennard.C
    Learning new things everyday...

  • Storm user newbie needs help with appcenter

    hi everyone. i need help regarding my blackbeery storm 9500. i bought from a friend but he only gave the charger and the the phone. there is no app center. is there anyway i could get the appcenter so that i can get the bbmessenger?

    You can download BBMessenger from your Blackberry browser at www.blackberry.com/bbm
    AppWorld: www.blackberry.com/appword
    You must have the BlackBerry Data Plan on your device to use either of those services.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Need Help with Average of a calculated field

    Good Morning ,
    In the cube that i built i have a calculated field "AvgAbandonTime"=round(([Measures].[C8]/[Measures].[C9]),0). C8 and C9 in the calculation are calculated fields in the DSV based off the fields from the Database.
    In the browser i'm having a problem. In the below sample data set , if you look i'm calculating the "AvgAbandonTime" per each location and this value is in seconds. C8 and C9 are the fields used in the calculation. For example C8/C9=11588/126=92
    (ROUNDED).Similarly for the other two rows. The problem is when it comes to the Grand Total , i'm expecting average of AvgAbandonTime over the 3 locations and that should be (92+16+73)/3=60, but where as what its doing is Summing all the C8 and all
    the C9 values and giving me the SUM(C8)/SUM(C9)=74. Please need help or advice.
    Thanks

    Thanks David,
    But no its not giving those values instead its giving
    C8
    C9
    Avg
    AvgAbandonTime11
    newcalc
    sum
    11588
    126
    92
    8191
    8191
    24753
    157
    10
    16
    157
    157
    24753
    62160
    857
    73
    16405
    16405
    24753
    GrandTotal
    73905
    993
    74
    99
    1.#INF
    24753

  • PS Newb needs help with image scaling and multi-sheet printout

    Hi, I'm trying to use PS CS3 to scale up an image I have so I can print it out to use as a map for a miniatures game.  I have no problem scaling the image to the appropriate size, but I can't figure out how to print out the image on multiple 8.5 x 11 sheets.  I had thought I'd seen an option for such a procedure previously, but maybe it was in another editing program.  If anyone has any ideas on how I might accomplish this I'd really appreciate hearing about them.  Thanks!

    Illustrator and InDesign do tiled printing as does CorelDraw. Photoshop as such does not, but some script for that may exist. In your case, the simplest solution would be to save the File as a PDF and have Acrobat generate a tiled print (Page Scaling setting in teh Acro print dialog). You just need to make sure your page properly fits multiple pages. Unliek AI and ID, Acro can only chop up stuff based on standard paper sizes...
    Mylenium

  • New to Java and need help with this program..please!

    I'd really appreciate any helpful comments about this program assignment that I have to turn in a week from Friday. I'm taking a class one night a week and completely new to Java. I'd ask my professor for help, but we can't call him during the week and he never answers e-mails. He didn't tell us how to call from other classes yet, and I just can't get the darn thing to do what I want it to do!
    The assignment requirements are:
    1. Change a card game application that draws two cards
    and the higher card wins, to a Blackjack application
    2. Include a new class called Hand
    3. The Hand class should record the number of draws
    4. The application should prompt for a number of draws
    5. The game is played against the Dealer
    6. The dealer always draws a card if the dealer's hand total is <= 17
    7. Prompt the player after each hand if he wants to quit
    8. Display the total games won by the dealer and total and the total games wond by the player after each hand
    9. Display all of the dealer's and player's cards at the
    end of each hand
    10. Player has the option of drawing an additional card after the first two cards
    11. The Ace can have a value of 11 or 1
    (Even though it's not called for in the requirements, I would like to be able to let the Ace have a value of 1 or an 11)
    The following is my code with some comments about a few things that are driving me nuts:
    import java.util.*;
    import javax.swing.*;
    import java.text.*;
    public class CardDeck
    public CardDeck()
    deck = new Card[52];
    fill();
    shuffle();
    public void fill()
    int i;
    int j;
    for (i = 1; i <= 13; i++)
    for (j = 1; j <= 4; j++)
    deck[4 * (i - 1) + j - 1] = new Card(i, j);
    cards = 52;
    public void shuffle()
    int next;
    for (next = 0; next < cards - 1; next++)
    int rand = (int)(Math.random()*(next+1));
    Card temp = deck[next];
    deck[next] = deck[rand];
    deck[rand] = temp;
    public final Card draw()
    if (cards == 0)
    return null;
    cards--;
    return deck[cards];
    public int changeValue()
    int val = 0;
    boolean ace = false;
    int cds;
    for (int i = 0; i < cards; i++)
    if (cardValue > 10)
    cardValue = 10;
    if (cardValue ==1)     {
    ace = true;
    val = val + cardValue;
    if ( ace = true && val + 10 <= 21 )
    val = val + 10;
    return val;
    public static void main(String[] args)
    CardDeck d = new CardDeck();
    int x = 3;
    int i;
    int wins = 1;
    int playerTotal = 1;
    do {
    Card dealer = (d.draw());
    /**I've tried everything I can think of to call the ChangeValue() method after I draw the card, but nothing is working for me.**/
    System.out.println("Dealer draws: " + dealer);
    do {
    dealer = (d.draw());
    System.out.println(" " + dealer);
    }while (dealer.rank() <= 17);
    Card mine = d.draw();
    System.out.println("\t\t\t\t Player draws: "
    + mine);
    mine = d.draw();
    System.out.println("\t\t\t\t\t\t" + mine);
    do{
    String input = JOptionPane.showInputDialog
    ("Would you like a card? ");
    if(input.equalsIgnoreCase("yes"))
         mine = d.draw();
    System.out.println("\t\t\t\t\t\t" + mine);
         playerTotal++;
         else if(input.equalsIgnoreCase("no"))
    System.out.println("\t\t\t\t Player stands");
         else
    System.out.println("\t\tInvalid input.
    Please try again.");
    I don't know how to go about making and calling a method or class that will combine the total cards delt to the player and the total cards delt to the dealer. The rank() method only seems to give me the last cards drawn to compare with when I try to do the tests.**/
    if ((dealer.rank() > mine.rank())
    && (dealer.rank() <= 21)
    || (mine.rank() > 21)
    && (dealer.rank() < 22)
    || ((dealer.rank() == 21)
    && (mine.rank() == 21))
    || ((mine.rank() > 21)
    && (dealer.rank() <= 21)))
    System.out.println("Dealer wins");
    wins++;
         else
    System.out.println("I win!");
    break;
    } while (playerTotal <= 1);
    String stop = JOptionPane.showInputDialog
    ("Would you like to play again? ");
    if (stop.equalsIgnoreCase("no"))
    break;
    if (rounds == 5)
    System.out.println("Player wins " +
    (CardDeck.rounds - wins) + "rounds");
    } while (rounds <= 5);
    private Card[] deck;
    private int cards;
    public static int rounds = 1;
    public int cardValue;
    /**When I try to compile this nested class, I get an error message saying I need a brace here and at the end of the program. I don't know if any of this code would work because I've tried adding braces and still can't compile it.**/
    class Hand()
    static int r = 1;
    public Hand() { CardDeck.rounds = r; }
    public int getRounds() { return r++; }
    final class Card
    public static final int ACE = 1;
    public static final int JACK = 11;
    public static final int QUEEN = 12;
    public static final int KING = 13;
    public static final int CLUBS = 1;
    public static final int DIAMONDS = 2;
    public static final int HEARTS = 3;
    public static final int SPADES = 4;
    public Card(int v, int s)
    value = v;
    suit = s;
    public int getValue() { return value; }
    public int getSuit() { return suit;  }
    public int rank()
    if (value == 1)
    return 4 * 13 + suit;
    else
    return 4 * (value - 1) + suit;
    /**This works, but I'm confused. How is this method called? Does it call itself?**/
    public String toString()
    String v;
    String s;
    if (value == ACE)
    v = "Ace";
    else if (value == JACK)
    v = "Jack";
    else if (value == QUEEN)
    v = "Queen";
    else if (value == KING)
    v = "King";
    else
    v = String.valueOf(value);
    if (suit == DIAMONDS)
    s = "Diamonds";
    else if (suit == HEARTS)
    s = "Hearts";
    else if (suit == SPADES)
    s = "Spades";
    else
    s = "Clubs";
    return v + " of " + s;
    private int value; //Value is an integer, so how can a
    private int suit; //string be assigned to an integer?
    }

    Thank you so much for offering to help me with this Jamie! When I tried to call change value using:
    Card dealer = (d.changeValue());
    I get an error message saying:
    Incompatible types found: int
    required: Card
    I had my weekly class last night and the professor cleared up a few things for me, but I've not had time to make all of the necessary changes. I did find out how toString worked, so that's one question out of the way, and he gave us a lot of information for adding another class to generate random numbers.
    Again, thank you so much. I really want to learn this but I'm feeling so stupid right now. Any help you can give me about the above error message would be appreciated.

  • Newbie need help with Web BEx setup!

    Out of curiosity, I decided to install Netweaver so I can have a play with it. I am a complete newbie to Netweaver therefore I apologise if this is out of context...
    Here's my question:
    How do one go about getting Web BEx to work?
    Whenever I activate the link in the portal, I get an error about unknown "SWITCH_AXES" command and 0ANALYSIS type 4 error. I search the forum and the few passing mentions of the problem points to OSS notes that is only accessible through service marketplace (which I don't have an ID). I have check the object types in BI content and seems that 0ANALYSIS is already activated. There must be something I am missing. Tried blindly and randomly installed other BI content (mostly Web templates and objects) but to no avail (and encounted a few short dumps).
    Any help is greatly appreciated!
    So far, here're what I did:
    1) Install Netweaver 2004S ABAP and Java on the same machine. Instance 00, 01 and 02 respectively.
    2) Try to run BI-Java template installer, but met with error part way. So some of the steps are done manually.
    3) Set up SLD (both instance are in the landscape), and 'partially' set up SSO. Partially as while JAVA to ABAP seems to work, ABAP to JAVA is not working. Anoying but livable.
    4) Installed TREX (instance 03) and are seen by ABAP and JAVA.
    5) ABAP is seen in the portal and I can create transactional iviews and put them in the Portal (with working SSO).
    6) Did reverse-proxying with Apache, but I don't think it matters as it seems to be a backend module issue.
    7) Business planning/wizard is working (in ABAP and Portal) as is Broadcast. As you can see, Web BEx is the only thing that is not working

    The default link for Web Analyser in EP 7 seems to point to the new template. When opening the analysis template in the new BEx windows tool, the same error is being reported. Using 3.5.x WAD, I can't locate the template.
    More on this issue Although for that case, the meta data is not installed. Is there a way to trace missing component and reinstall the needed BI content in RSA1?
    BTW, these are on JAVA SP9 and ABAP SP11.

  • New logic user, need help with multi-channel inst and aux strips.

    Greetings all,
    So I just purchased a new Mac Pro 2.66 and Logic Pro 7 to run with it. I have been a long time Nuendo/Cubase user on the PC side of things but since I got the Mac I wanted a DAW that was supported fully for the apple platform.
    Anyways, its a world of difference and I am very confused as I wrap my head around the learning curve, so in the meantime I have one important question maybe some one could help me with.
    The question is regarding Aux channel stips for Multi channel instruments. In this scenario I am working with Battery 3, it took me a while to understand that I actually needed to create these aux channels just to have seperate outs in Battery which seems really wierd and overly time consuming.
    As an example in Nuendo once you create the instance of Battery, the audio mixer automatically just creates the corresponding stereo and mono channels instantly. This obviously makes is a sinch to assign Batteries pads to seperate outs for eq/comps for seperate sounds.
    Now the Battery manual doesnt even make a reference to Aux channels for assigning outs in Logic, I actually had to do a Google search to figure this out.
    Anways, sorry for rambling...
    Here is the main issue.... How can I quickly and easily create multiple Aux's? In the mixer there is really only enough room in there to add like 1 more Aux strip, if I want to add more than that I need to re-arrange the entire global mixer which seems like a crazy system, surely there must be a more convenient method for getting muti-channel audio instruments set up quicker.
    Any help you can assist with would be exceptional!
    Thanks in advance.

    Not sure what exactly your question is, especially since I don't use battery. But as far as creating aux tracks:
    • go to the audio layer of the environment (not the track mixer window), find the two defalt aux tracks
    • Highlight all tracks to the right of the aux tracks (these should be bus and output tracks), and drag to the right far enough to fit in a bunch of aux tracks; you might even want to drag the all underneath the aux tracks, if your screen accomodates
    • use the key command shift-command-a multiples times to create several new "audio objects", and double click each one to expand
    • highlight all the new objects and select options/clean up/ align objects (makes it look nicer)
    • still highlighted, over in the parameters section (left side) select a channel, setting it to the highest number aux (at this point, probably "aux 3")
    • now individual set the channel for each aux track – you'll see that now you have available "aux 4"; next time you set a successive track you'll see "aux 5" and so on
    • once you've got things set up the way you want, save it as a template so you don't have to do this again later

  • Need help with drawLine method

    Hello,
    I've been having trouble with a recent programming assignment and the prof isn't being very helpful. I need to call the drawLine method to plot a line between (0,0) and two coordinates entered by the user; is there a way to do this without a JPanel? Here are the specs:
    I've already done Part 1., just posting it to give a complete representation of the assignment.
    Part 1. Implement a ComplexNumber class to represent complex numbers (z = a + bi).
    1) Instance variables:
    private int real; /* real part */
    private int imag; /* imaginary part */
    2) Constructor:
    public ComplexNumber ( int realVal, int imagVal )
    { /* initialize real to realVal and imag to imagVal */ }
    3) Get/Set functions:
    public int getReal ( )
    { /* returns the real part */ }
    public int getImag ( )
    { /* returns the imaginary part */ }
    public void setReal ( int realVal )
    { /* sets real to realVal */ }
    public void setImag ( int imagVal )
    { /* sets imag to imagVal */ }
    Part 2. Implement a ComplexNumberPlot class (with a main method) that gets complex
    numbers from the user and plots them. The user will be prompted a complex number until
    he/she enters 0. The numbers will be input from the keyboard (System.in) and displayed
    in the plot as they are entered. Assume that the user will enter the numbers in blank
    separated format. For example, if the user wants to enter three complex numbers: 3 + 4i,
    5 + 12i, and 15 + 17i, the input sequence will be:
    3 4
    5 12
    15 17
    0 0
    To plot a complex number, you need to draw a line between (0,0) and (real, imag) using
    the drawLine method.
    Name your classes as ComplexNumber and ComplexNumberPlot.
    For simplicity, you can assume that the complex numbers input by the user fall
    into the first quadrant of the complex plane, i.e. both real and imaginary values
    are positive.
    Thanks for any help!

    Ok I've made some progress, here is what I've got.
    public class ComplexNumber
    private int real;
    private int imag;
    public ComplexNumber (int realVal, int imagVal)
    real = realVal;
    imag = imagVal;
    public int getReal()
    return real;
    public int getImag()
    return imag;
    public void setReal(int realVal)
    real = realVal;
    public void setImag(int imagVal)
    imag = imagVal;
    import java.util.Scanner;
    import java.awt.*;
    import javax.swing.*;
    public class ComplexNumberPlot
    public static void main (String [] args)
    ComplexNumber num = new ComplexNumber (1,0);
    Scanner scan = new Scanner (System.in);
    System.out.println("Enter a complex number(s):");
    num.setReal(scan.nextInt());
    num.setImag(scan.nextInt());
    while (num.getReal() + num.getImag() != 0)
    num.setReal(scan.nextInt());
    num.setImag(scan.nextInt());
    System.out.println();
    JFrame frame = new JFrame ("ComplexNumberPlot");
    frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
    ComplexPanel panel = new ComplexPanel();
    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
    class ComplexPanel extends JPanel
    public ComplexPanel()
    setPreferredSize (new Dimension(150,150));
    public void PaintComponent (Graphics page)
    super.paintComponent(page);
    page.drawLine(0,0,100,100);
    However
    1) The JPanel pops up but no line is drawn.
    2) I am not sure how to get the variables I'm scanning for to work in the drawLine method
    Thanks for all your help so far.

Maybe you are looking for