Helparray

Subject: help!
Problem is:i have to replace the biggest and the smallest element each column
for inctance : 235 678
456 456
678 235
<?php
$muut[0][0] = $HTTP_POST_VARS['n1']; //element value
$muut[0][1] = $HTTP_POST_VARS['n2'];
$muut[0][2] = $HTTP_POST_VARS['n3'];
$muut[1][0] = $HTTP_POST_VARS['n4'];
$muut[1][1] = $HTTP_POST_VARS['n5'];
$muut[1][2] = $HTTP_POST_VARS['n6'];
$muut[2][0]=$HTTP_POST_VARS['n7'];
$muut[2][1] = $HTTP_POST_VARS['n8'];
$muut[2][2] = $HTTP_POST_VARS['n9'];
for($i=0;$i<3;$i++)
$min=$muut[0][$i];$min1=0;$max1=0;
for($j=1;$j<3;$j++)
if($muut[$j][$i]<$min)
{ $min1=$j; $min=$muut[$j][$i];
if($muut[$j][$i]>$min)
{$max1=$j;$max=$muut[$j][$i];
$muut[$min1][$i]=$max;
$max=$min;
?>

I don't see any Java here :)

Similar Messages

  • Creating GUI

    I want to focus on the "Help" tab at this point. I want to be able to display different information each time the user hits the "next" or "previous" buttons in the "help" section. I figured the easiest way would be to set up an array in the HelpMenu class, but I'm having difficulty getting started. Say I had 5 different tips. How would I set it up so that I could display some text or graphic on the HelpMenu screen, depending on which array cell I was currently at. And how would I make it that if I was at the beginning or end of the array, the previous or next buttons would not be able to go any further?
    import java.awt.Dimension;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class MainMenu extends JFrame {
         private Toolkit toolkit;
         public MainMenu() {
              setTitle("TechnoPong");
              setSize(450, 400);
              toolkit = getToolkit();
              Dimension size = toolkit.getScreenSize();
              setLocation((size.width - getWidth())/2, (size.height - getHeight())/2);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              JPanel panel = new JPanel();
              getContentPane().add(panel);
              panel.setLayout(null);
              JButton beep = new JButton("Beep");
              beep.setBounds(50, 60, 80, 30);
              beep.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent event) {
                        toolkit.beep();
              JButton help = new JButton("Help");
              help.setBounds(50, 150, 80, 30);
              help.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent even) {
                        HelpMenu helpScreen = new HelpMenu();
                        helpScreen.setVisible(true);
                        helpScreen.setResizable(false);
              JButton exit = new JButton("Exit");
              exit.setBounds(50, 250, 80, 30);
              exit.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent event) {
                        System.exit(0);
              panel.add(beep);
              panel.add(help);
              panel.add(exit);
         public class HelpMenu extends JFrame {
              private Toolkit toolkit2;
              private int[] helpArray = new int[5];
              public HelpMenu() {
                   setTitle("TechnoPong Help");
                   setSize(700, 300);
                   Dimension size = toolkit.getScreenSize();
                   setLocation((size.width - getWidth())/2, (size.height - getHeight())/2);
                   JPanel panel = new JPanel();
                   getContentPane().add(panel);
                   panel.setLayout(null);
                   JButton next = new JButton("Next");
                   next.setBounds(575, 200, 80, 30);
                   next.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent event) {
                             System.exit(0);
                   JButton back = new JButton("Back");
                   back.setBounds(40, 200, 80, 30);
                   back.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent even) {
                             System.exit(0);
                   panel.add(next);
                   panel.add(back);
         public static void main(String[] args) {
              MainMenu mainScreen = new MainMenu();
              mainScreen.setVisible(true);
    }

    You'd have an instance variable which told you which array cell you were at. Clicking the "next" button would increment that variable (and redisplay), clicking the "previous" button would decrement it (and redisplay).
    Also, setting it to zero should disable the "previous" button and setting it to the max value should disable the "next" button. Which of course should be re-enabled when those conditions stop applying.

  • Need help assigning values to an array of Strings

    why do i get an error message saying this isn't a statement?
    String customer[z] = {"::" + s1 + ":" + s2 + ":" + s3};
    what is the correct syntax for assigning values to an array of strings?

    help helpArrays in Java are static, meaning their size cannot change once they've been created. Somewhere in your code you need to declare the String array like this,
    String[] costumer = new String[10];Now customer has 10 elements (room for 10 strings) and you can do for example this,
    int z = 0;
    costumer[z] = "string1" + "string2";This means the two strings are added and assigned to element 0 of the array.
    If you can't take it from here you need to step back for a while and carefully study a beginners textbook on Java.

  • Need help assigning ringtone to contact

    I have followed all the instructions regarding assigning a ringtone to a contact, but when that individual calls, the phone uses the default ringtone. How do I get this to work?

    help helpArrays in Java are static, meaning their size cannot change once they've been created. Somewhere in your code you need to declare the String array like this,
    String[] costumer = new String[10];Now customer has 10 elements (room for 10 strings) and you can do for example this,
    int z = 0;
    costumer[z] = "string1" + "string2";This means the two strings are added and assigned to element 0 of the array.
    If you can't take it from here you need to step back for a while and carefully study a beginners textbook on Java.

Maybe you are looking for

  • Database Migration:Resolving DB links issue.

    Hi, We are to migrate one of our production database to a new server. The DB version is 11.2.0.3 and it is on AIX 6.1. There will be no change in version of DB or OS. In our setup there are some number of other Oracle databases which connects to this

  • Automator Workflow as Finder Plug In Doesn't Seem to Work Correctly

    Has anyone noticed that if you create an Automator Workflow as a Finder Plug-in in Leopard it does not seem to work correctly or at all? I have a two action Workflow. 1. Get Selected Finder Items 2. Import Files into iPhoto When run inside Automator,

  • Application redirect page to maintenance ...

    Hello, I would like to redirect my application url to a maintenance page when application taken down for maintenance. I'm using WL 10.3.2 and OHS.  I've configures mod_wl_ohs to redirect the url. Any pointers/help would be appreciated? Kind regards,

  • Request for alv

    hai all, when i try to generate report for ztables i am getting the following dump <b>error:</b> Short text     Field symbol has not yet been assigned. <u>Error analysis:</u>     You attempted to access an unassigned field symbol     (data segment 92

  • Mail won't open after installing security update

    hi i just installed the newest security update and now mail won't open. i get the spinning ball of death. has anyone else had this problem or have any ideas how to fix it without reinstalling everything? thanks.