HELPP PLEASE i need help solving this algorithm please!!

Read the following algorithm for the recursive procedure called Mystery.
MYSTERY(soFar, toGo)
length = LEN(toGo)
IF length = 1 THEN
PRINT soFar & toGo
ELSE
FOR i = 1 to length
MYSTERY(soFar & MID$ (toGo, i, 1),LEFT$(toGo, i � 1)
& RIGHT$(toGo, length � i))
NEXT i
ENDIF
END of procedure
Where:
LEN(aSTRING) returns the number of characters in the string held in aString,
MID$(aString, n,m) returns m characters of aString starting at the nth,
LEFT$(aString, n) returns the first n characters of aString,
RIGHT$(aString, n) returns the last n characters of aString,
& joins two strings together (concatenation).
(a) Give the output if the procedure is called by
MYSTERY('' '', ''RED'')
(b) The function is called with
MYSTERY('' '', ''AB'')
Write down all the instructions, including procedure calls, in the order in which they are
executed. You must show the values of the variables in each instruction.

I'd to ask your tutor or classmates for help with homework.
I don't see any relation with Java by the way.

Similar Messages

  • Services disappearing? Need help solving this.

    Over the years I have created many Services (using automator and applescript), so that when you right click a folder or file you have the option to click on the service.
    However In the recent weeks it has come up where sometimes the Service field disappears. How I get them back is logging out and then logging back in.
    Does this mean I have some virus or something? Is there a way to handle this?
    Here is what is supposed to come up:
    Here is what happens sometimes:
    Thanks guys

    How often do you need to do this? I think that a script which would work properly may be more work than is worth the time.
    I'm sure something like this could be done, but the real problem would be what would the next group of lines that you run the script on look like? Would a script that works for this circumstance work properly for another shape?
    Here's some parameters to think about:
    How do you determine which line segments (or endpoints) in the document need to be connected? All points in the document, or will you be working with a selection?
    Once you determine the points (eliminating all that are already connected), how do you want them connected, and which point do you start with? Connect to the closest available point would seem what you want, but depending on how you determine which point to start with could give you different results.
    You might want to loop through all eligible points, and save the distance to every other point into an array. Then, loop through connecting the 2 closest available points until you've connected every point.

  • Need help solving this tricky connect paths problem!

    I need to convert a bunch of separate paths  in particular way so they create one single continuos path as shown in the attached PNG file.
    It has me stumped. Does anyone know of a way to do this via scripting?

    How often do you need to do this? I think that a script which would work properly may be more work than is worth the time.
    I'm sure something like this could be done, but the real problem would be what would the next group of lines that you run the script on look like? Would a script that works for this circumstance work properly for another shape?
    Here's some parameters to think about:
    How do you determine which line segments (or endpoints) in the document need to be connected? All points in the document, or will you be working with a selection?
    Once you determine the points (eliminating all that are already connected), how do you want them connected, and which point do you start with? Connect to the closest available point would seem what you want, but depending on how you determine which point to start with could give you different results.
    You might want to loop through all eligible points, and save the distance to every other point into an array. Then, loop through connecting the 2 closest available points until you've connected every point.

  • I need help solving this problem!!

    Hi, i'm new to java and have written only a few programs, i recently wrote one and had the following error but dont know why...........
    Exception in thread "main" java.lang.NoClassDefFoundError: quadraticsolverApp
    I have included my code below.....
    import java.applet.Applet;
    public class quadraticsolver extends Applet
    public double a, b, c ;
    public void init()
    a=0;
    b=0;
    c=0;
    public String getRoot1()
    if (getDescriminent() < 0.0 || this.a == 0.0)
    return "" + ((-b + Math.sqrt(-getDescriminent()))/(2 * a)) + " i";
    else
    return "" + ((-b + Math.sqrt(getDescriminent()))/(2 * a));
    public String getRoot2()
    if (getDescriminent() < 0.0 || a == 0.0)
    return "" + ((-b - Math.sqrt(-getDescriminent()))/(2 * a)) + " i";
    else
    return "" + ((-b - Math.sqrt(getDescriminent()))/(2 * a));
    public double getDescriminent()
    return (b*b - 4 * a * c);
    public void setA(double bValue)
    a = bValue;
    public void setB(double bValue)
    b = bValue;
    public void setC(double bValue)
    c = bValue;
    Thanks for the help
    Noel
    email: [email protected]

    Besides that, the code is broken. For instance
    return "" + ((-b - Math.sqrt(-getDescriminent()))/(2 * a)) + " i";should be
    return "" + (-b/(2*a)) + " " + (-Math.sqrt(-getDescriminent())/(2 * a)) + " i";
    to get correct answers... 1/2 * (-1-sqrt(3)) i (or approximately -1.36602540 i) is not a solution of x^2 + x + 1 = 0. Also, if a is small, it's better to use the formula x = 2*c / (-b +/- sqrt(b^2 - 4ac))

  • Need Help solving this issue

    Hey everyone. I'm new to Java and I'm experimenting with JCombo box in a timesheet program I'm trying to make. Can someone please tell me why, in the following code, if i enter text to the JComboBox and hit enter, it adds an item two times to the list, and creates two buttons, but if i select an item from the list it adds the item back to the list once and only creates one button.
    I would prefer to have just one button created as well as have a selection from the drop down list not be added back in. I'm confused as to how to implement this though because it would seem to me that an action listener on the combo box would listen for both the key event and the dropdown selection.
    The code
    package timesheet;
    import java.awt.*;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import java.awt.Toolkit;
    import java.awt.BorderLayout;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    * @author Jamie Snipes
    public class Main extends JFrame implements ActionListener{
    public static void main(String[] args) {
    new Main().setVisible(true);
    /** Creates a new instance of Main */
    public Main() {
    initComponents();
    pack();
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = getSize();
    setLocation(new Point((screenSize.width - frameSize.width),
    (screenSize.height - frameSize.width)/ 6 ));
    * @param args the command line arguments
    private void initComponents() {
    mainPanel = new javax.swing.JPanel();
    mainPanel.setLayout(new BorderLayout());
    eventTrackerPanel = new javax.swing.JPanel();
    //eventTrackerPanel.setLayout(new GridLayout(5,1, 5, 5));
    projectTitleLabel = new javax.swing.JLabel();
    buttonsPanel = new javax.swing.JPanel();
    buttonsPanel.setLayout(new BorderLayout());
    newItemPanel = new javax.swing.JPanel();
    newItemPanel.setLayout(new FlowLayout());
    startButton = new javax.swing.JButton("Start");
    notesButton = new javax.swing.JButton("Add Note");
    stopButton = new javax.swing.JButton("Stop");
    menuBar = new javax.swing.JMenuBar();
    menuItem= new javax.swing.JMenuItem("Exit");
    menu= new javax.swing.JMenu("File");
    addTimeSheetItem= new javax.swing.JButton("Add") ;
    projectArray= new String[10];
    removeProjectButton=new javax.swing.JButton("remove") ;
    setTitle("Time Sheet");
    //Menu Bar Itmes
    // menu.setMnemonic(KeyEvent.VK_A);
    // menu.getAccessibleContext().setAccessibleDescription();
    menuBar.add(menu);
    menuItem.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    if(evt.getSource()==menuItem){
    exitMenuItemActionPerformed(evt);
    menu.add(menuItem);
    setJMenuBar(menuBar);
    mainPanel.setLayout(new java.awt.BorderLayout());
    mainPanel.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(5, 5, 5, 5)));
    mainPanel.setMinimumSize(new java.awt.Dimension(800, 800));
    projectTitleLabel.setText("Project Name:");
    //Top Panel
    projectNameBox= new javax.swing.JComboBox();
    projectNameBox.setEditable(true);
    eventTrackerPanel.setLayout(new GridLayout(0,1, 5, 5));
    projectNameBox.addActionListener(this);
    eventTrackerPanel.add(projectNameBox);
    newItemPanel.add(projectNameBox);
    newItemPanel.add(addTimeSheetItem);
    // buttonsPanel (Bottom) Panel
    buttonsPanel.add(startButton, BorderLayout.WEST);
    buttonsPanel.add(notesButton, BorderLayout.CENTER);
    buttonsPanel.add(stopButton, BorderLayout.EAST);
    // Main Panel
    mainPanel.add(newItemPanel, BorderLayout.NORTH);
    mainPanel.add(eventTrackerPanel, BorderLayout.CENTER);
    mainPanel.add(buttonsPanel, BorderLayout.SOUTH);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    getContentPane().add(mainPanel);
    getContentPane().setSize(800, 800);
    public void actionPerformed(ActionEvent e){
    if(e.getSource()==projectNameBox){
    for(int i=0; i<=100; i++){
    selectedProjectToggleButton= new javax.swing.JToggleButton[100];
    projectArray= new String();
    selectedProjectToggleButton= new javax.swing.JToggleButton();
    projectArray=(String)projectNameBox.getSelectedItem();
    System.out.println(projectArray);
    projectNameBox.addItem(projectArray);
    selectedProjectToggleButton.setText(projectArray);
    eventTrackerPanel.add(selectedProjectToggleButton);
    return;
    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
    System.exit(0);
    // Variables declaration - do not modify
    private javax.swing.JPanel buttonsPanel;
    private javax.swing.JPanel newItemPanel;
    private javax.swing.JPanel eventTrackerPanel;
    private javax.swing.JMenuItem exitMenuItem;
    private javax.swing.JLabel feedbackLabel;
    public javax.swing.JMenu fileMenu;
    private javax.swing.JButton[] buttonArray;
    private javax.swing.JButton startButton;
    private javax.swing.JButton stopButton;
    private javax.swing.JButton notesButton;
    private javax.swing.JButton addTimeSheetItem;
    private javax.swing.JButton removeProjectButton;
    private javax.swing.JLabel projectTitleLabel;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenuItem menuItem;
    private javax.swing.JMenu menu;
    private javax.swing.JComboBox projectNameBox;
    private java.awt.event.ActionListener isClicked;
    private int i;
    private javax.swing.JToggleButton[] selectedProjectToggleButton;
    private String[] projectArray;
    private java.lang.Boolean projectEntered;
    private String projectName;
    // End of variables declaration
    }

    make this the 1st line of your actionPerformed method...
    System.out.println(e.getActionCommand());
    You will see that when you type in the box and then click ADD it makes 2 things happen.
    comboBoxEdited
    comboBoxChanged
    And when you select from the drop down list all you get is 1 thing
    comboBoxChanged
    Just put an IF statement in there that only looks for "comboBoxChanged" actions and then it should work.

  • I need help solving Latest Flash Player upgrade crashing issues.

    I recently upgraded my flash player at Adobe reccomendation. Now it crashes all the time. I need help solving this issue. I currently have Flash Version 11.5.502.135. My old version never crashed, not even once. I would be fine uninstalling the new version and going back to the older one but i cant find it.

    Could you please create a crash report? The following page has more information: http://helpx.adobe.com/flash-player/kb/report-flash-player-crash.html
    You can install Flash Player 11.4.402.287 version.
    Thanks,
    Sunil

  • My Mac was updated to Ÿosemite OS and since then the PS5 software doesn't open. I need help on this subject please.

    My Mac was updated to Ÿosemite OS and since then the PS5 software doesn't open. I need help on this subject please.
    They error message I get is "An unexpected and unrecoverable problem has occurred. Photoshop will now exit."
    This only started after I upgraded my OS to Yosemite.

    The upgrade has been know to break Photoshop CS5 installs. An Uninstall/Reinstall may be necessary.

  • Help urgently needed, I have installed Logic Pro 9, since then my Final Cut Pro X keep freezing. Anyone what is wrong and how to solve it? I desperately need help on this. Thanks

    Help urgently needed, I have installed Logic Pro 9, since then my Final Cut Pro X keep freezing. Anyone what is wrong and how to solve it? I desperately need help on this. Apple support says I have to pay £85 for to help me. Thanks

    Just a word of advice. Never ever use the word "urgent" on this forum

  • Please I really need help with this video problem.

    Hi!
    Please I need help with this app I am trying to make for an Android cellphone and I've been struggling with this for a couple of months.
    I have a main flash file (video player.fla) that will load external swf files. This is the main screen.When I click the Sets Anteriores button I want to open another swf file called sets.swf.The app is freezing when I click Sets Anteriores button
    Here is the code for this fla file.
    import flash.events.MouseEvent;
    preloaderBar.visible = false;
    var loader:Loader = new Loader();
    btHome.enabled = false;
    var filme : String = "";
    carregaFilme("home.swf");
    function carregaFilme(filme : String ) :void
      var reqMovie:URLRequest = new URLRequest(filme);
      loader.load(reqMovie);
      loader.contentLoaderInfo.addEventListener(Event.OPEN,comeco);
      loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progresso);
      loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completo);
      palco.addChild(loader); 
    function comeco(event:Event):void
              preloaderBar.visible = true;
              preloaderBar.barra.scaleX = 0;
    function progresso(e:ProgressEvent):void
              var perc:Number = e.bytesLoaded / e.bytesTotal;
              preloaderBar.percent.text = Math.ceil(perc*100).toString();
              preloaderBar.barra.scaleX =  perc;
    function completo(e:Event):void
              preloaderBar.percent.text = '';
              preloaderBar.visible = false;
    btHome.addEventListener(MouseEvent.MOUSE_DOWN,onHomeDown);
    btHome.addEventListener(MouseEvent.MOUSE_UP,onHomeUp);
    btSets.addEventListener(MouseEvent.MOUSE_DOWN,onSetsDown);
    btSets.addEventListener(MouseEvent.MOUSE_UP,onSetsUp);
    btVivo.addEventListener(MouseEvent.MOUSE_DOWN,onVivoDown);
    btVivo.addEventListener(MouseEvent.MOUSE_UP,onVivoUp);
    btHome.addEventListener(MouseEvent.CLICK,onHomeClick);
    btSets.addEventListener(MouseEvent.CLICK,onSetsClick);
    function onSetsClick(Event : MouseEvent) : void
              if (filme != "sets.swf")
                          filme = "sets.swf";
                          carregaFilme("sets.swf");
    function onHomeClick(Event : MouseEvent) : void
              if (filme != "home.swf")
                          filme = "home.swf";
                          carregaFilme("home.swf");
    function onHomeDown(Event : MouseEvent) : void
              btHome.y += 1;
    function onHomeUp(Event : MouseEvent) : void
              btHome.y -= 1;
    function onSetsDown(Event : MouseEvent) : void
              btSets.y += 1;
    function onSetsUp(Event : MouseEvent) : void
              btSets.y -= 1;
    function onVivoDown(Event : MouseEvent) : void
              btVivo.y += 1;
    function onVivoUp(Event : MouseEvent) : void
              btVivo.y -= 1;
    Now this is the sets.fla file:
    Here is the code for sets.fla
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    var video:Video;
    var nc:NetConnection;
    var ns:NetStream;
    var t : Timer = new Timer(1000,0);
    var meta:Object = new Object();
    this.addEventListener(Event.ADDED_TO_STAGE,init);
    function init(e:Event):void{
    video= new Video(320, 240);
    addChild(video);
    video.x = 80;
    video.y = 100;
    nc= new NetConnection();
    nc.connect(null);
    ns = new NetStream(nc);
    ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);
    ns.bufferTime = 1;
    ns.client = meta;
    video.attachNetStream(ns);
    ns.play("http://www.djchambinho.com/videos/segundaquinta.flv");
    ns.pause();
    t.addEventListener(TimerEvent.TIMER,timeHandler);
    t.start();
    function onStatusEvent(stat:Object):void
              trace(stat.info.code);
    meta.onMetaData = function(meta:Object)
              trace(meta.duration);
    function timeHandler(event : TimerEvent) : void
      if (ns.bytesLoaded>0&&ns.bytesLoaded == ns.bytesTotal )
                ns.resume();
                t.removeEventListener(TimerEvent.TIMER,timeHandler);
                t.stop();
    The problem is when I test it on my computer it works but when I upload it to my phone it freezes when I click Sets Anteriores button.
    Please help me with this problem I dont know what else to do.
    thank you

    My first guess is you're simply generating an error. You'll always want to load this on your device in quick debugging over USB so you can see any errors you're generating.
    Outside that, if you plan on accessing anything inside the SWF you should be loading the SWF into the correct context. Relevant sample code:
    var context:LoaderContext = new LoaderContext();
    context.securityDomain = SecurityDomain.currentDomain;
    context.applicationDomain = ApplicationDomain.currentDomain;
    var urlReq:URLRequest = new URLRequest("http://www.[your_domain_here].com/library.swf");
    var ldr:Loader = new Loader();
    ldr.load(urlReq, context);
    More information:
    http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7de0.html
    If you're doing this on iOS you'll need to stripped SWFs if you plan on using any coding (ABC) inside the files. You mentioned iOS so I won't get into that here, but just incase, here's info on stripping external SWFs:
    http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-swfs-for-air- apps-on-ios/

  • Please help! I am trying to change my Apple Id that used to be my mother to Mine- Every time i have it changed and i go and try and do an update it continues to ask for her old password. I really need help with this!

    Please help! I am trying to change my Apple Id that used to be my mother to Mine- Every time i have it changed and i go and try and do an update it continues to ask for her old password. I really need help with this!

    Phil0124 wrote:
    Apps downloaded with an Apple ID are forever tied to that Apple ID and will always require it to update.
    The only way around this is to delete the apps that require the other Apple ID and download them again with yours.
    Or simply log out of iTunes & App stores then log in with updated AppleID.

  • Please need help with this query

    Hi !
    Please need help with this query:
    Needs to show (in cases of more than 1 loan offer) the latest create_date one time.
    Meaning, In cases the USER_ID, LOAN_ID, CREATE_DATE are the same need to show only the latest, Thanks!!!
    select distinct a.id,
    create_date,
    a.loanid,
    a.rate,
    a.pays,
    a.gracetime,
    a.emailtosend,
    d.first_name,
    d.last_name,
    a.user_id
    from CLAL_LOANCALC_DET a,
    loan_Calculator b,
    bv_user_profile c,
    bv_mr_user_profile d
    where b.loanid = a.loanid
    and c.NET_USER_NO = a.resp_id
    and d.user_id = c.user_id
    and a.is_partner is null
    and a.create_date between
    TO_DATE('6/3/2008 01:00:00', 'DD/MM/YY HH24:MI:SS') and
    TO_DATE('27/3/2008 23:59:00', 'DD/MM/YY HH24:MI:SS')
    order by a.create_date

    Perhaps something like this...
    select id, create_date, loanid, rate, pays, gracetime, emailtosend, first_name, last_name, user_id
    from (
          select distinct a.id,
                          create_date,
                          a.loanid,
                          a.rate,
                          a.pays,
                          a.gracetime,
                          a.emailtosend,
                          d.first_name,
                          d.last_name,
                          a.user_id,
                          max(create_date) over (partition by a.user_id, a.loadid) as max_create_date
          from CLAL_LOANCALC_DET a,
               loan_Calculator b,
               bv_user_profile c,
               bv_mr_user_profile d
          where b.loanid = a.loanid
          and   c.NET_USER_NO = a.resp_id
          and   d.user_id = c.user_id
          and   a.is_partner is null
          and   a.create_date between
                TO_DATE('6/3/2008 01:00:00', 'DD/MM/YY HH24:MI:SS') and
                TO_DATE('27/3/2008 23:59:00', 'DD/MM/YY HH24:MI:SS')
    where create_date = max_create_date
    order by create_date

  • I need make icloud account but tell me the operation couldn't be completed please iam need to solve this problem necessary, Thank you

    i need make icloud account but tell me the operation couldn't be completed please iam need to solve this problem necessary, Thank you

    Why don't you use the option "Get a Free Apple ID" to create a new iCloud account with a free @icloud.com email address for all the iCloud service like Mail, Contacts, Calendars, Reminders, Notes Storage & Backup etc.?
    This would be the easiest way.

  • My ipad turns off randomly and doesnt turn back on and wont restore with itunes and i tried holding the power and home button down and i see a faint apple logo than it disappears and still does not operate please help solve this issue

    My ipad turns off randomly and doesnt turn back on and wont restore with itunes and i tried holding the power and home button down and i see a faint apple logo than it disappears and still does not operate please help solve this issue

    i have the same problem...my ipod is 4th generation?uggghhhhh

  • My macbook Pro 13" 2013 has a mouse problem, its not moving naturally, and keeps on moving around like its dancing. Please help solve this!!

    My macbook Pro 13" 2013 has a mouse problem, its not moving naturally, and keeps on moving around like its dancing. Please help solve this!!

    Go step by step and test.
    1. Restart
    2. Shut down the computer.
        Clean the trackpad with moist not wet microfiber cloth.
        System Preferences > Point & Click
        Try turning off three finger dragging and then turning it on after  testing.
    3. Is there any Bluetooth device nearby with failing batteries? If so, replace the batteries.
      4. Reset PRAM:   http://support.apple.com/kb/PH14222
    5. Reset SMC.     http://support.apple.com/kb/HT3964
        Choose the method for:
        "Resetting SMC on portables with a battery you should not remove on your own".
    6. Close all windows and quit all applications.
        Click the Spotlight -the magnifying glass icon- in the menu bar. Enter Disk utility in the box.
        Select Disk Utility from the drop down. When the Disk utility window opens up,
        select  Macintosh HD, then First Aid.
        Click Repair Disk Permissions button.
        Ignore the  time remaining estimate.
        Last 1 minute may take longer.

  • I need help with this script please ASAP

    So I need this to work properly, but when ran and the correct answer is chosen the app quits but when the wrong answer is chosen the app goes on to the next question. I need help with this ASAP, it is due tommorow. Thank you so much for the help if you can.
    The script (Sorry if it's a bit long):
    #------------Startup-------------
    display dialog "Social Studies Exchange Trviva Game by Justin Parzik" buttons {"Take the Quiz", "Cyaaaa"} default button 1
    set Lolz to (button returned of the result)
    if Lolz is "Cyaaaa" then
    killapp()
    else if Lolz is "Take the Quiz" then
              do shell script "say -v samantha Ok starting in 3…2…1…GO!"
    #------------Question 1-----------
              display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
              set A1 to (button returned of the result)
              if A1 is "Apprentices" then
                        do shell script "say -v samantha Correct Answer"
              else
                        do shell script "say -v samantha Wrong Answer"
      #----------Question 2--------
                        display dialog "Most children were taught
    to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
                        set A2 to (button returned of the result)
                        if A2 is "Bible" then
                                  do shell script "say -v samantha Correct Answer"
                        else
                                  do shell script "say -v samantha Wrong Answer"
      #------------Question 3---------
                                  display dialog "In the 1730s and 1740s, a religious movement called the_______swept through the colonies." buttons {"Glorius Revolution", "Great Awakening", "The Enlightenment"}
                                  set A3 to (button returned of the result)
                                  if A3 is "Great Awakening" then
                                            do shell script "say -v samantha Correct Answer"
                                  else
                                            do shell script "say -v samantha Wrong Answer"
      #-----------Question 4--------
                                            display dialog "_______ was
    a famous American Enlightenment figure." buttons {"Ben Franklin", "George Washington", "Jesus"}
                                            set A4 to (button returned of the result)
                                            if A4 is "Ben Franklin" then
                                                      do shell script "say -v samantha Correct Answer"
                                            else
                                                      do shell script "say -v samantha Wrong Answer"
      #----------Question 5-------
                                                      display dialog "______ ownership gave colonists political rights as well as prosperity." buttons {"Land", "Dog", "Slave"}
                                                      set A5 to (button returned of the result)
                                                      if A5 is "Land" then
                                                                do shell script "say -v samantha Correct Answer"
                                                      else
                                                                do shell script "say -v samantha Wrong Answer"
      #---------Question 6--------
                                                                display dialog "The first step toward guaranteeing these rights came in 1215. That
    year, a group of English noblemen forced King John to accept the…" buttons {"Declaration of Independence", "Magna Carta", "Constitution"}
                                                                set A6 to (button returned of the result)
                                                                if A6 is "Magna Carta" then
                                                                          do shell script "say -v samantha Correct Answer"
                                                                else
                                                                          do shell script "say -v samantha Wrong Answer"
      #----------Question 7--------
                                                                          display dialog "England's cheif lawmaking body was" buttons {"the Senate", "Parliament", "King George"}
                                                                          set A7 to (button returned of the result)
                                                                          if A7 is "Parliament" then
                                                                                    do shell script "say -v samantha Correct Answer"
                                                                          else
                                                                                    do shell script "say -v samantha Wrong Answer"
      #--------Question 8-----
                                                                                    display dialog "Pariliament decided to overthrow _______ for not respecting their rights" buttons {"King James II", "King George", "King Elizabeth"}
                                                                                    set A8 to (button returned of the result)
                                                                                    if A8 is "King James II" then
                                                                                              do shell script "say -v samantha Correct Answer"
                                                                                    else
                                                                                              do shell script "say -v samantha Wrong Answer"
      #--------Question 9------
                                                                                              display dialog "Parliament named ___ and ___ as England's new monarchs in something called ____." buttons {"William/Mary/Glorius Revolution", "Adam/Eve/Great Awakening", "Johhny/Mr.Laphalm/Burning of the hand ceremony"}
                                                                                              set A9 to (button returned of the result)
                                                                                              if A9 is "William/Mary/Glorius Revolution" then
                                                                                                        do shell script "say -v samantha Correct Answer"
                                                                                              else
                                                                                                        do shell script "say -v samantha Wrong Answer"
      #---------Question 10-----
                                                                                                        display dialog "After accepting the throne William and Mary agreed in 1689 to uphold the English Bill of _____." buttons {"Money", "Colonies", "Rights"}
                                                                                                        set A10 to (button returned of the result)
                                                                                                        if A10 is "Rights" then
                                                                                                                  do shell script "say -v samantha Correct Answer"
                                                                                                        else
                                                                                                                  do shell script "say -v samantha Wrong Answer"
      #---------Question 11------
                                                                                                                  display dialog "By the late 1600s French explorers had claimed the ___ River Valey" buttons {"Mississippi", "Ohio", "Hudson"}
                                                                                                                  set A11 to (button returned of the result)
                                                                                                                  if A11 is "Ohio" then
                                                                                                                            do shell script "say -v samantha Correct Answer"
                                                                                                                  else
                                                                                                                            do shell script "say -v samantha Wrong Answer"
      #------Question 12---------
                                                                                                                            display dialog "______ was sent to ask the French to leave 'English Land'." buttons {"Johhny Tremain", "George Washington", "Paul Revere"}
                                                                                                                            set A12 to (button returned of the result)
                                                                                                                            if A12 is "George Washington" then
                                                                                                                                      do shell script "say -v samantha Correct Answer"
                                                                                                                            else
                                                                                                                                      do shell script "say -v samantha Wrong Answer"
      #---------Question 13-------
                                                                                                                                      display dialog "_____ proposed the Albany Plan of Union" buttons {"George Washingon", "Ben Franklin", "John Hancock"}
                                                                                                                                      set A13 to (button returned of the result)
                                                                                                                                      if A13 is "Ben Franklin" then
                                                                                                                                                do shell script "say -v samantha Correct Answer"
                                                                                                                                      else
                                                                                                                                                do shell script "say -v samantha Wrong Answer"
      #--------Question 14------
                                                                                                                                                display dialog "The __________ declared that England owned all of North America east of the Mississippi" buttons {"Proclomation of England", "Treaty of Paris", "Pontiac Treaty"}
                                                                                                                                                set A14 to (button returned of the result)
                                                                                                                                                if A14 is "" then
                                                                                                                                                          do shell script "say -v samantha Correct Answer"
                                                                                                                                                else
                                                                                                                                                          do shell script "say -v samantha Wrong Answer"
      #-------Question 15-------
                                                                                                                                                          display dialog "Braddock was sent to New England so he could ______" buttons {"Command an attack against French", "Scalp the French", "Kill the colonists"}
                                                                                                                                                          set A15 to (button returned of the result)
                                                                                                                                                          if A15 is "Command an attack against French" then
                                                                                                                                                                    do shell script "say -v samantha Correct Answer"
                                                                                                                                                          else
                                                                                                                                                                    do shell script "say -v samantha Wrong Answer"
      #------TheLolQuestion-----
                                                                                                                                                                    display dialog "____ is the name of the teacher who runs this class." buttons {"Mr.White", "Mr.John", "Paul Revere"} default button 1
                                                                                                                                                                    set LOOL to (button returned of the result)
                                                                                                                                                                    if LOOL is "Mr.White" then
                                                                                                                                                                              do shell script "say -v samantha Congratulations…you…have…common…sense"
                                                                                                                                                                    else
                                                                                                                                                                              do shell script "say -v alex Do…you…have…eyes?"
                                                                                                                                                                              #------END------
                                                                                                                                                                              display dialog "I hope you enjoyed the quiz!" buttons {"I did!", "It was horrible"}
                                                                                                                                                                              set endmenu to (button returned of the result)
                                                                                                                                                                              if endmenu is "I did!" then
                                                                                                                                                                                        do shell script "say -v samantha Your awesome"
                                                                                                                                                                              else
                                                                                                                                                                                        do shell script "say -v alex Go outside and run a lap"
                                                                                                                                                                              end if
                                                                                                                                                                    end if
                                                                                                                                                          end if
                                                                                                                                                end if
                                                                                                                                      end if
                                                                                                                            end if
                                                                                                                  end if
                                                                                                        end if
                                                                                              end if
                                                                                    end if
                                                                          end if
                                                                end if
                                                      end if
                                            end if
                                  end if
                        end if
              end if
    end if

    Use code such as:
    display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
    set A1 to (button returned of the result)
    if A1 is "Apprentices" then
    do shell script "say -v samantha Correct Answer"
    else
    do shell script "say -v samantha Wrong Answer"
    return
    end if
    #----------Question 2--------
    display dialog "Most children were taught to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
    set A2 to (button returned of the result)
    if A2 is "Bible" then
    do shell script "say -v samantha Correct Answer"
    else
    do shell script "say -v samantha Wrong Answer"
    return
    end if
    (90444)

Maybe you are looking for

  • BAMAdapter Issue : java.rmi.ConnectException: Destination unreachable;

    Hi, I have installed SOA server and BAM server on same localhost but while calling BAM adapter from the BPEL process it's throwing below error. *<Jun 24, 2011 6:56:51 PM BST> <Error> <oracle.soa.bpel.engine.ws> <BEA-000000>* *<got FabricInvocationExc

  • Receiving a pdf file from R3 in WebDynPro

    Hello Experts, I have a requirement like I need to have a button to download PDF. The PDF has to come from SAP R/3 . Now i cant use Adobe Interactive form as the PDF layout will change from time to time. I will need to call an RFC and the RFC has to

  • ActionScript 2.0 vs 3.0 NetConnection

    I have some code I've been using to connect to a streaming server. This version is compiled for ActionScript 2.0: netConnection = new NetConnection(); netConnection.onStatus = function(info) { trace("status: " + info.code); netConnection.connect("rtm

  • VEHICLE AVAILABILITY STATUS

    hi we want to change the Availability Status of vehicle from *Available for Contract to Not In Service* Can any 1 able to guide how to do it? Regards

  • T61 recover from xp to vista

    The original os of my T61 is vista. I installed xp and kept the recovery partition. Now I want to recover to the original vista but cannot find the option when I press ThinkVantage at startup! The recovery partition is there but just cannot be used.