HELP I'M NEW TO CODING BUT HAVE A PROJECT (BASIC)

I'm trying to build a code for a project. It's very simple. 
I need to use either a random number generator which generates numbers 1 to 3 or I need to be able to enter a number in.  Depending on whether the number is 1, 2, or 3, will determine what will happen.
For number 1, a green light will go on and a dialogue box with pre-entered text will pop up.
For number 2, a green light and red light will go on as well as another dialogue box with pre-entered text.
For number 3, a green light, red light, and two different dialogue boxes will pop up.
I really need help fast.. Thank you!

That's not a LabVIEW question anymore, but a math question.  Generating random numbers is something that should be taught in any basic programming class.
The random number generator gives a number from 0 to 1.  Zero is part of the data set, 1 is not.  So 0  to  0.999999999..
You want a range of 1, 2, 3 integers only.
Multiply by 3.  Now you'll have a number from 0 to 2.999999 ....
Add 1,  Now you'll have a number from 1 to 3.99999999....
Round down towards -infinity  Now you'll have 1, 2, or 3.

Similar Messages

  • I tried to restore backup from itune to my new iphone 5s but have forgotten the password what should I do?

    I tried to restore backup from itune to my new iphone 5s but have forgotten the password what should I do?

    JennyGEL wrote:
    I ... have forgotten the password what should I do?
    Which password?
    If you mean the passcode to your iPhone, here's the solution:
    http://support.apple.com/kb/HT1212
    If you mean the encryption password to your backup on your computer:
    Warning: Make sure it's a password you will remember or write it down for safekeeping. If you encrypt an iPhone backup in iTunes and forget your password, you can't restore from backup and your data will be unrecoverable.
    If you can't remember the password and want to start again, you must perform a full software restore and chooseset up as a new device when iTunes prompts you to select the backup from which to restore.

  • HT5012 I recently got a new ipad air, but have not been able to download any app, not even the free o es, ha tocan i do?

    I recently got a new ipad air, but have not been able to download any app, not even the free o es, ha tocan i do?

    You are required to provide credit card details to download apps be it free or paid.
    Nothing will be deducted from your credit card if the app is free.
    There will be a authorizing hold of US$1.00 to verify your account information. It will be credited back to your account later.

  • My itunes account was set up under an email account that has been deleted. I started a new itunes account but have the same device as with the old account. How do i keep my music thats on my ipod touch from being deleted when i sync it to my new account?

    My itunes account was set up under an email account that has been deleted. I started a new i tunes account but have the same device as with the old account. How do i keep my music thats on my ipod touch from being deleted whin i sync it to itunes after purchasing new music?

    I have the same problem (deleted email account). I think I mistakenly set up an account when I was buying an Apple product online, not realizing that it would be the same ID as my iTunes.
    What is the way to actually contact Apple?
    I have been clicking around in circles for hours! Will I have to pay them to resolve this? I don't have any products still have applecare . . .

  • I have ID, use a Mac, have Yosemite 10.10.2 - have not used ID for awhile but have a project but cannot open it because I need Jave SE6 runtime and cannot download it. Do I need an upgrade? Please help I have a project

    I need to download Java Se6 runtime in order to use InDesign but cannot download it. Please help as I have a project that must get done. If I need an upgrade please let me know.

    There is a Java update for Yosemite that includes what you need.

  • I created new iCloud account but have not received email to verify

    Set up new iCloud account but never received email to allow me to verify

    Hi Sergei1447,
    Welcome to the Apple Support Communities!
    If you are not receiving the verification email from creating your iCloud account you may need to resend it. Also make sure you are checking your junk/spam folders. Please use the following article as a reference.
    iCloud: Account troubleshooting
    http://support.apple.com/kb/ts3988
    I can't sign in to iCloud on my Mac due to an alert stating that my email address has not been verified.
    If you can't sign in due to the alert “Account not verified - Check your email for instructions for verifying your account”:
    Close and reopen iCloud preferences before attempting to sign in to iCloud again.
    If that does not resolve the issue, check your email folder and Junk folder for a verification email sent from Apple.
    If there is no verification email in your email folder or Junk folder, click the Resend Verification Email button in iCloud preferences.
    I hope this helps,   
    -Joe

  • Help .. am new to db in hava

    hi there
    i have this code i guess its a database connection to MYSQL ...
    i need to change it to SQL SERVER 2000 .....
    so how it differs .....?????and i need some comments to understand what its all about ?
    please this is urgent ....???
    * Servlet for DB connection*/
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class getConnection extends HttpServlet
    public void init()
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException
    BufferedReader in = request.getReader();
    String db = in.readLine();
    String user = in.readLine();
    String pwd = in.readLine();
    /*String db = "test";
    String user = "root";
    String pwd = "caspian";*/
    String message ="jdbc:mysql://localhost:3306/"+
    db+","+user+","+pwd;
    try
    connect(db.toLowerCase().trim(),user.toLowerCase().trim(),
    pwd.toLowerCase().trim());
    message += "100 ok";
    catch (Throwable t)
    message += "200 " + t.toString();
    response.setContentType("text/plain");
    response.setContentLength(message.length());
    PrintWriter out = response.getWriter();
    out.println(message);
    out.println(db);
    out.println(user);
    out.println(pwd);
    out.flush();
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException
    doPost(request,response);
    /* This method connects to MYSQL database*/
    private void connect(String db, String user,
    String pwd) throws Exception
    // Establish a JDBC connection
    // to the MYSQL database server.
    //Class.forName("org.gjt.mm.mysql.Driver");
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection conn = DriverManager.getConnection(
    "jdbc:mysql://localhost:3306/"+db,user,pwd);
    // Establish a JDBC connection to the Oracle database server.
    //DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    //Connection conn = DriverManager.getConnection(
    "jdbc:oracle:thin:@localhost:1521:"+db,user,pwd);
    // Establish a JDBC connection to the SQL database server.
    //Class.forName("net.sourceforge.jtds.jdbc.Driver");
    //Connection conn = DriverManager.getConnection(
    // jdbc:jtds:sqlserver://localhost:1433/+db,user,pwd);
    }

    I've added comments and fixed the formatting (and use the [ code ] tags to make it more readable).
    However, you can figure 90% of this out from reading the java.sql API:
    http://java.sun.com/j2se/1.5.0/docs/api/java/sql/package-summary.html
    and the rest you can get by Googling for tutorials and documentation, such as this one:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;313100
    You might also look at the basics of httpservlet, e.g.:
    http://www.jayeckles.com/tutorials/servlets.pc
    /* Servlet for DB connection*/
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class getConnection extends HttpServlet
      // HttpServlet - init() method should only present if it's being overridden
      //public void init()
      public void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException
        // this isn't how you normally get request information from an http request
        // BufferedReader in = request.getReader();
        // get the parameters from the web form by name
        // replace the quoted values with whatever the fields actual names are
        //    and clean up the data ASAP
        String db = request.getParameter("db").toLowerCase().trim();
        String user = request.getParameter("user").toLowerCase().trim();
        String pwd = request.getParameter("pwd").toLowerCase().trim();
        /*String db = "test";
        String user = "root";
        String pwd = "caspian";*/
        String message ="jdbc:mysql://localhost:3306/"+db+","+user+","+pwd;
        try
          connect(db,user,pwd);
          message += "100 ok";
        // you normally shouldn't catch Error throwables, only the Exception throwables
        //   Error throwables are non-recoverable errors and it's usually a bad thing to catch them
        catch (Exception e)
          message += "200 " + e.toString();
        response.setContentType("text/plain");
        // it's not required to set a ContentLength, but it you do set it, DO NOT set it wrong
        //    if set, it should be the length of everything set to the "out" PrintWriter,
        //      including line end characters
        // response.setContentLength(message.length());
        PrintWriter out = response.getWriter();
        out.println(message);
        out.println(db);
        out.println(user);
        out.println(pwd);
        // this is unneeded, flush is automatic when the servlet ends
        //    it can't hurt and in some scenarios it's helpful
        // out.flush();
      // treate GET requests the same as posts
      public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException
        doPost(request,response);
      /* This method connects to MYSQL database*/ 
      private void connect(String db, String user, String pwd) throws Exception
        // Establish a JDBC connection
        // to the MYSQL database server.
        //Class.forName("org.gjt.mm.mysql.Driver");
        // load the MySQL driver class
        // every database has a different one
        Class.forName("com.mysql.jdbc.Driver").newInstance();
        // ask the driver manager for a connection for this database URL
        // this assumes that the database is running on your machine and
        //     is using the standard MySQL port
        // the DriverManager figures out which driver is needed by asking each loaded driver
        //    if it knows how to handle the database URL, the first paramter of the method
        Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/"+db,user,pwd);
        // Establish a JDBC connection to the Oracle database server.
        //DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
        //Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:"+db,user,pwd);
        // Establish a JDBC connection to the SQL database server using the jtds driver.
        //Class.forName("net.sourceforge.jtds.jdbc.Driver");
        //Connection conn = DriverManager.getConnection(
        // jdbc:jtds:sqlserver://localhost:1433/+db,user,pwd);
    }

  • New to Visual Studio 2008, not new to CR - but have  question

    Hi,
    I started a position to build reports for a small company.  They use VS 2008 and Crystal 2008 (basic).  I am not new to Crystal Reports, been using it since version 4.0.  But I am new to integrating it into Visual Studio or using it to deploy reports via a web application.
    I was able to create a dataset, connect Crystal to the Dataset in Visual Studio and design a report. 
    There are two tabs on the bottom of the Crystal Window - one is to the design side and one is to preview the main page of the report.
    So here in lies the problem - when I go to view the results - there are none.  It is random or dummy data being presented in Visual Studio 2008. 
    I have scoured MSDN and SAP forums looking for help in this.  I see other posts that elude to the same issue, but --there has to be some way to see the data in Visual Studio.
    Can someone explain to me why I don't see the real data from the dataset?   And more importantly where is the tutorials for Visual Studio 2008 and Crystal Reports 2008?
    Thanks so much for your help!

    Hi,
    I have also seen the same, that is report displays dummy data at my end however when you run the report from application you get the data that is when you pass the dataset to the report at runtime and not while previewing the report. I believe this is because when we use datasets to design a report we consider the schema of the report mainly not data.
    If you mean that you do not get any data in the report then I would suggest you to use the below mentioned code to generate an xsd file, after filling up the dataset so that the report schema and the dataset schema matches.
    datasetObject.WriteXml("c:\\temp\\myData1.xml",XmlWriteMode.WriteSchema);
    Regards,
    AG.

  • New to ipad but have charged it and done what I think should be done however the time shows about 8 hours wrong but find my ipad is on???

    the new ipad is set as icloud  find my ipad but the clock is 8 hours wrong  help please

    Hi, to change the time and/or date go into Settings, general, Date & Time. From here you have the option to "set automatically", if you turn this off a third option will appear where you can manually set the time and date. Hope this helps.

  • HT1451 I have just downloaded the new updated iTunes but have lost all of my 'non purchased' files and when i go to sync my apple devices it tells me that 'these devices are not linked, this will erase the content before sync'. has anyone else found this?

    I have just down loaded the new iTunes and after completion i discovered that all of my imported non-purchased music was missing and my purchased music was now only available from the cloud.
    How do i retrieve the old vertsion of iTunes? I also do not want to use the cloud as i prefer hard drive storage, can i retrive my files from the cloud and de-activate / block it from my windows laptop?
    Help?

    iTunes: Finding lost media and downloads - Support - Apple
    If you have non-itunes music on your computer still, you should have no problem relocating them and reuploading to itunes.
    Hope this helps.

  • I have a new iphone 4 but have a problem in that the network reads Sim not provisioned, please advise how to overcome this problem?

    My new iphone has been recognised by itunes, updated the software but unable to connect to a network, on checking "Network" the phone is searching but to no avail. In "About, Network, there is a statement reading SIM not provisioned". I have no idea what this refers to perhaps someone could advise? 

    I've managed to speak to someone who knew what he was talking about and having confirmed the original sim on my iPhone 3 followed by confirming the number on the iPhone 4 Micro Sim he advised that the new micro sim had not been activated. As a direct result we'll head off to one of their support offices to activate and hopefully pass on the iphone 3 to another of our employees after a reset of course!

  • What do i do if i need to make a new apple account but have gift card money on the one im using now?

    i have to make a new apple id because i cant remember the security questions to my old one and cant use the money i have on it. but i dont want that money to go to waste. is there any way to transfer that money to the new account i want to create?

    You can't transfer a balance from one account to another account, nor use it to gift content to another account. Have you tried getting the questions on your existing account reset ?
    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then go to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you should see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then you won't get the reset option - you will need to contact iTunes Support or Apple to get them reset.
    e.g. you can try contacting iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then 'Forgotten Apple ID security questions'
    or try ringing Apple in your country and ask to talk to the Accounts Security Team : http://support.apple.com/kb/HE57
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down this page to add a rescue email address for potential future use : http://support.apple.com/kb/HT5312 . Or you could change to 2-step verification : http://support.apple.com/kb/HT5570

  • Help!! New W530 and I have a recovery disc creation error?

    Hi, I just got a brand new W530 and got an error when creating the recovery discs.  Now the process won't restart.   Is there a solution? 
    The partition is still there but the wizard won't start up again so I can't give it another shot.
    Solved!
    Go to Solution.

    Hello and welcome,
    There may be a way to re-enable the recovery creation process.  There was with older machines.  I don't know what the current situation is, but others may chime in.
    The best course might be to call support and request the recovery media.  I can't speak for Lenovo, but it's common for them to be sent free in this situation.
    Z.
    United States
    THINK-branded products
    English
    1-800-426-7378
    24 hours/day
    7 days/week
    IDEA-branded and
    B, C, E, G, H, K, N, Q, V, Y Series Products
    English
    1-877-4 Lenovo
    (1-877-453-6686)
    24 hours a day
    7 days a week
    The large print: please read the Community Participation Rules before posting. Include as much information as possible: model, machine type, operating system, and a descriptive subject line. Do not include personal information: serial number, telephone number, email address, etc.  The fine print: I do not work for, nor do I speak for Lenovo. Unsolicited private messages will be ignored. ... GeezBlog
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество

  • My ipod touch 4th generation no longer holds it's charge for more than 40mins,needs new internal battery but I have no idea how to go about this. i love my ipod and don't want it to loose power completely, can anyone help?

    My ipod touch 4th generation no longer holds it's charge for more than 40mins from full power, think it needs a new internal battery but have no idea how to go about this and am no longer covered by my guarantee. Can anyone advise me on what's best? Thanks in advance

    Using the battery level meter in this manner is comparable to using your car's fuel gauge to calculate miles per gallon. The only thing that matters is the total amount of operating time from full charge to auto-shutdown.
    Use an Apple wall-mount charger.  Do NOT use a computer's USB port.  Then, operate it normally until auto shut-down (ignore any low level alerts that may appear).  An irony is that doing that test to determine the total operating time is also the exact procedure necessary to calibrate the battery level meter.
    I'm not claiming that you do not have a problem.  I am stating, however, that we don't yet know whether or not a battery problem exists.
    According to Apple:
    Use Your iPod Regularly
    For proper reporting of the battery’s state of charge, be sure to go through at least one charge cycle per month (charging the battery to 100% and then completely running it down).
    Elsewhere, Apple elaborates and explains that two half-discharges (or four quarter-discharges, etc.) equals one full discharge.

  • New OS 5 on my Iphone 4 but have lost all my pictures, need to retreive them.

    I did an upgrade on my Iphone 4 to the new OS 5 but have lost all of my pictures that had not been sync with the computer yet. Is there a way to retreive them ?

    It doesn't do that by itself. You have to manually initiate a restore.
    If you weren't backing up to iCloud and you didn't have Photo Stream on so the photos could upload to the cloud, they're gone. You can't recover them.

Maybe you are looking for

  • What is the direct link between Schedule Line item and Delivery line item?

    Hi SAP SD Gurus, The question is simple.  I would like to calculate the Open order quantity for a particular month based on the Schedule Line Date. I am taking all the Schedule lines falling below the running date of the month and sum up that and loo

  • Plase Help - Issues with Charing my Zen Stone Plus

    I am have this player initially i used to charge to 00% now its just charging upto 9% i keep for charging more than 8 hours still it happening the same. Updated the firmware to latest reset it twice i really don't know what to do. Please help me on t

  • BI Bookmarks in Portal Favorites

    Hi I am facing an issue with opening navigated and saved reports via Portal Favorites. In the integrated BI report in the portal, I enter the variables in the variable entry screen and run the report. After the report loads, I click on 'Save As...' b

  • Iphone randomly clicks on stuff for no reason

    My iphone goes randomly clicking on stuff for no reason, it only stops if you turn it off then back on then starts doing it again the phone is only 1 week old went to Telstra store in Gawler SA and they said i needed a virus protection on it.  Since

  • Teststand sockets

    TestStand using sockets, I have two Teststand sequences and I would like to condition the sequence to run using sockets. The two sequences are called from a Main Sequence. The test environment is connected to a database through a custom barcode inter