The Student Room Group

IB Computer science HELP!

I have chosen standard computer science and I have a terrible teacher. We have to do this task for the Christmas holidays and I have no idea how to even approach it. We have to make a functioning button which allows the user to choose from a genre of film, then pick a film from the list before clicking on it which shows what the film is about. Can someone give me a template for this or tell me the titles of what I have to use in order to achieve this?Thank you so much! Xx
You could start out by just adding the empty components to your UI - i.e. the button, the drop-down lists, and then something like a textbox, text area or label which you can later get to show the film description.

You didn't mention what programming language you've been asked to use or which UI tool (e.g. Java Swing, or JavaFX), but if you're unsure of those, do some google searches, or search on StackOverflow for examples, because you could break down your task into a lot of very small problems, each of which will almost certainly have been asked there before, so you should find lots of examples and answers:

e.g. assuming Java Swing, try google searches like this:
- "How do I add a dropdown list to Java Swing"
- "How do I set data for a dropdown list"
- "How do I change the text of something when clicking a button in Java Swing".
- "How do I link two dropdown lists together in Java Swing"
etc. (if it's something else such as a button on a webpage, then just search for those instead..)

Check the names of the components you need - for example, a button in Java Swing is called a JButton, but is just called 'Button' in JavaFX. A google search should turn up some results with some basic tutorials for those components, so you should be able to find plenty of information about them which you can piece together.

Moving away from your UI and to your data - think about what you actually need to do with the data, and let that guide how to structure your films and genres in a way which makes them useful to solving the problem - You have been asked to essentially create a filter for a list of films by their genre, so try creating classes/structs/objects which can usefully represent those things in code; if you can't visualise it, try drawing it out on paper first, but it doesn't matter if you don't get it right first time - there's never an absolutely right/wrong way to structure data - just whatever makes it easier or harder for the thing you're trying to do.

Also consider how to uniquely identify each of your films/genres so that you can connect them to your dropdown lists later on.
The concept of giving something a unique identity is very common in programming - it solves alot of problems (for example, you might have two different films with the same title, so you can't use the title - people often resort to using something like an ID number instead to make things easier - e.g. if you know that you have created a Genre ID number 8 for "Sci Fi", and a genre ID number 3 for "Horror", then each film in your data might just include a field which matches that number.

You're being asked to filter films based on genre - I'd suggest starting out writing a stand-alone method/function which doesn't use your UI yet - for example, if you know how to identify a particular genre in your data, think about the code you'd need to write to get all films which match that genre, and get back a list of those matching films.

Remember that nearly every problem can often be broken down into smaller ones - until it becomes small enough that you can just google it or figure it out. If you look at a problem and it seems too big and complicated, then take a tiny bite out of it and work on that - eventually the big problem that seemed too difficult or impossible will just turn into a whole load of small things which you were able to understand.

Good luck!
Reply 2
Is this gcse? I think every gcse computer science teacher is bad atleast everyone I have met had a bad one :P I just used alot of forums and somehow got an A
Reply 3
Thank you, thank you, thank you! You have no idea what a life saver you are! This has been a huge help and when i come to doing the task I bet I'll be fine. I am doing java so the examples were spot on 😂.
I wish I could pay you back for such an amazing and detailed answer.
I'll let you know how I get on,
Bobo xxx

Quick Reply

Latest

Trending

Trending