Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

intro To Programing exam

Options
2»

Comments

  • Registered Users Posts: 305 ✭✭Ajfunky


    I wish i could do a little code of a plane bursting into flames then crashing, but i guess if i could do that i wouldnt have horribly failed that exam.

    True or false me bolliX! i wrote some awful ****e in that exam..


  • Registered Users Posts: 1,380 ✭✭✭remus808


    They've obviously made it much harder since Fintan's days of glory


  • Registered Users Posts: 188 ✭✭Jack Bracken


    Anyone want to scan the paper and put it up? Really curious what has you all so p***ed, and how it compares to Programming 1.


  • Registered Users Posts: 5,570 ✭✭✭RandomName2


    I can't be bothered to scan it yet; but here's the meat of it:

    'The function, which you will call "sum" should take a single floating point number as an argument, and return a floating point corresponding to the sum of the square roots of all the positive integers that are smaller or equal to the argument. The rest of your code should, continuously: record a String numbers input by the user through the keyboard; when the ENTER or RETURN key is pressed, the complete number typed by the user should be converted into a floating point and input in to the "sum" function; the result of the "sum" function should be printed on the console alongside its argument, and used to control the size of an ellipse drawn on the screen.' :eek:

    And, my favourite....

    In this exercise you have to design a function that operates on arrays (12 marks), and to use it (18 marks). The function, called "sort A" should receive as arguments the array and an integer representing its size, and sort the values contained in the array in decreasing order - you cannot use any predefined Processing sorting function for this task. The rest of the code should: create an array of as many int as the height of the window (minimum 200), fill it with random values in the [0,255] range; sort them using sort A; create a gradient of grey between the top and the bottom of the window, controlled by the values in the array.' :eek::eek:

    And those two were worth 60% of the exam.

    Happy happy days!


  • Registered Users Posts: 5,570 ✭✭✭RandomName2


    In fact, looking at last year's java programming paper I think I would have found it a lot easier...

    EVEN THOUGH I DON'T KNOW JAVA!


  • Advertisement
  • Registered Users Posts: 188 ✭✭Jack Bracken


    Not too bad, but it is more complicated than the Programming 1 paper, which I think is odd. o__O


  • Registered Users Posts: 545 ✭✭✭ravydavygravy


    I can't be bothered to scan it yet; but here's the meat of it:

    'The function, which you will call "sum" should take a single floating point number as an argument, and return a floating point corresponding to the sum of the square roots of all the positive integers that are smaller or equal to the argument. The rest of your code should, continuously: record a String numbers input by the user through the keyboard; when the ENTER or RETURN key is pressed, the complete number typed by the user should be converted into a floating point and input in to the "sum" function; the result of the "sum" function should be printed on the console alongside its argument, and used to control the size of an ellipse drawn on the screen.' :eek:

    And, my favourite....

    In this exercise you have to design a function that operates on arrays (12 marks), and to use it (18 marks). The function, called "sort A" should receive as arguments the array and an integer representing its size, and sort the values contained in the array in decreasing order - you cannot use any predefined Processing sorting function for this task. The rest of the code should: create an array of as many int as the height of the window (minimum 200), fill it with random values in the [0,255] range; sort them using sort A; create a gradient of grey between the top and the bottom of the window, controlled by the values in the array.' :eek::eek:

    And those two were worth 60% of the exam.

    Happy happy days!

    Maybe the standard of CS is slipping, but neither problem strikes me as particularly difficult. I'd hope any first year student could write a basic sorting algorithm (of your choice!), and the first function seems trivial. The only complication is the graphical add-on, but I suspect Processing has utility functions to make these easy.

    EDIT: actually, that came across a bit harsh - obviously sorry that it didn't go well for you -I have no idea how relevant these questions were to the course you were given. I used to tutor many CS students, so I can only go by what we used to teach in first year 6-7 years ago.

    Happy Christmas,

    Dave


  • Closed Accounts Posts: 8,880 ✭✭✭Raphael


    Maybe the standard of CS is slipping, but neither problem strikes me as particularly difficult. I'd hope any first year student could write a basic sorting algorithm (of your choice!), and the first function seems trivial. The only complication is the graphical add-on, but I suspect Processing has utility functions to make these easy.

    EDIT: actually, that came across a bit harsh - obviously sorry that it didn't go well for you -I have no idea how relevant these questions were to the course you were given. I used to tutor many CS students, so I can only go by what we used to teach in first year 6-7 years ago.

    Happy Christmas,

    Dave
    Well, for one thing, intro to programming is a course for non CS students. CS students took Programming 1, which apparently had an easier exam.


  • Registered Users Posts: 1,186 ✭✭✭Nichololas


    That seems a little complicated for a 1st year course, especially one for non-CS students. Sucks to be you guys, I guess.


  • Registered Users Posts: 5,570 ✭✭✭RandomName2


    Maybe the standard of CS is slipping, but neither problem strikes me as particularly difficult. I'd hope any first year student could write a basic sorting algorithm (of your choice!), and the first function seems trivial. The only complication is the graphical add-on, but I suspect Processing has utility functions to make these easy.

    EDIT: actually, that came across a bit harsh - obviously sorry that it didn't go well for you -I have no idea how relevant these questions were to the course you were given. I used to tutor many CS students, so I can only go by what we used to teach in first year 6-7 years ago.

    Happy Christmas,

    Dave

    Well.. um.. yeah. A basic sorting algorithm was an okay prospect. Creating an ellipse? You couldn't get more simple. Indeed pretty much all of the individual steps were feasible enough, at least on paper.

    I actually thought that the questions looked okay when I read them first. But I know how to get the square root of some float, and I also know how to use a sorting algorithm in descending order.

    I don't know how to: return a floating point corresponding to the sum of the square roots of all the positive integers that are smaller or equal to an argument which happens to be the size of a string which is determined by continual keyboard input but only executed when enter or return is pressed (what the **** is return anyway? and what is the name of ENTER (as it isn't a char.... and I don't know the Unix -or whatever- number that it corresponds to.... Was this even covered in the lectures? :confused:) Actually making the sum of all the ints less than or equal to the keyboard input string, a parameter of a shape, was the easy part of that particular question.

    Maybe in several months time I will know how to do those two questions. As it is I don't actually feel at all ashamed getting an F attempting to answer that nonsense.


  • Advertisement
  • Registered Users Posts: 334 ✭✭meathawk


    Excercise 2 was just a bitch as was excercise 3, they were meant to be challenging I suppose. They were giving marks away in the first question and excercise 1. I amn't expecting amazing marks but so long as I get a C (with assignments and exam) I don't mind that much. Excercise too was such a joke though, very tough.


  • Registered Users Posts: 545 ✭✭✭ravydavygravy


    Since Its apparent that the course is for non-CS students you do have some of my pity. I think a lot of the problem comes from the way the questions are phrased - they make the problem sound more complicated than it is.

    For example:
    'The function, which you will call "sum" should take a single floating point number as an argument, and return a floating point corresponding to the sum of the square roots of all the positive integers that are smaller or equal to the argument. The rest of your code should, continuously: record a String numbers input by the user through the keyboard; when the ENTER or RETURN key is pressed, the complete number typed by the user should be converted into a floating point and input in to the "sum" function; the result of the "sum" function should be printed on the console alongside its argument, and used to control the size of an ellipse drawn on the screen.'

    All it really says is "read numbers from the keyboard in an infinite loop - each time, take the number, calculate its SUM (as defined below) and use the number to draw an ellipse. SUM is defined as the sum of the square roots of all positive integers <= the input number" - heres my pseudo-code:
    function main()
    {
      while (true)
      {
        // Read string from keyboard
        num_as_string = read_from_keyboard();
    
        // turn it into a float
        num = parseFloat(num_as_string);
        
        // calculate sum
        curr_sum = SUM(num);
    
        // print out the answers
        print num + " results to " + curr_sum;
    
        // draw an ellipse using the two numbers
        draw_ellipse(num,curr_sum);
      }
    }
    
    // Function to calculate SUM 
    function SUM(float number)
    {
        //start with nothing
        result = 0;
    
        // go through the positive integers, one by one, as 
        // long as the current number is <= the input number
        for (int i=1; i<=number; i++)
        {
            // add the square root of this integer to the running total
            result = result + sqrt(i);
        }
    
        // return the final total
        return result;
    }
    

    Like i said, I'm not familiar with Processing, but in Java/PHP/Perl/C#, the actual code wouldn't be much longer than the pseudocode...

    I hope this is helpful - I assume you'll need to repeat at some point...


  • Registered Users Posts: 5,570 ✭✭✭RandomName2


    Since Its apparent that the course is for non-CS students you do have some of my pity. I think a lot of the problem comes from the way the questions are phrased - they make the problem sound more complicated than it is.

    For example:



    All it really says is "read numbers from the keyboard in an infinite loop - each time, take the number, calculate its SUM (as defined below) and use the number to draw an ellipse. SUM is defined as the sum of the square roots of all positive integers <= the input number" - heres my pseudo-code:
    function main()
    {
      while (true)
      {
        // Read string from keyboard
        num_as_string = read_from_keyboard();
    
        // turn it into a float
        num = parseFloat(num_as_string);
        
        // calculate sum
        curr_sum = SUM(num);
    
        // print out the answers
        print num + " results to " + curr_sum;
    
        // draw an ellipse using the two numbers
        draw_ellipse(num,curr_sum);
      }
    }
    
    // Function to calculate SUM 
    function SUM(float number)
    {
        //start with nothing
        result = 0;
    
        // go through the positive integers, one by one, as 
        // long as the current number is <= the input number
        for (int i=1; i<=number; i++)
        {
            // add the square root of this integer to the running total
            result = result + sqrt(i);
        }
    
        // return the final total
        return result;
    }
    

    Like i said, I'm not familiar with Processing, but in Java/PHP/Perl/C#, the actual code wouldn't be much longer than the pseudocode...

    I hope this is helpful - I assume you'll need to repeat at some point...

    Thanks. Hopefully I wont need to repeat due to assignments (3 As, 2 Cs).

    Oh, that should be i--, by the way :D.

    It would have helped had they had practicals (or tutorials) with the course.


  • Registered Users Posts: 545 ✭✭✭ravydavygravy


    Oh, that should be i--, by the way :D.

    Check again, only harder :-)


Advertisement