The Student Room Group

What am I supposed to do?

So I do a computer science and just started. My teacher told us to do a programming homework (that requires you to know a programming language). I haven't been taught anything about programming. Was I supposed to learn all these languages before I started the course? And how else am I supposed to do the homework without me copying someone else's program. The homework was about encrypting and decrypting a caesar cypher.
Original post by EchoesAct3
So I do a computer science and just started. My teacher told us to do a programming homework (that requires you to know a programming language). I haven't been taught anything about programming. Was I supposed to learn all these languages before I started the course? And how else am I supposed to do the homework without me copying someone else's program. The homework was about encrypting and decrypting a caesar cypher.

So we can't possibly answer questions about what your teacher expects you to know, whether you were supposed to learn things beforehand, etc. You'll have to ask your course leader for that.

In terms of the problem at hand, it's unclear what you need to do. Are you expected to write your own program? Are you just expected to solve the cipher, and programming is one method that was recommended?

At it's core, the problem seems like it can be broken into two parts. Understanding the Caesar cipher, and coming up with a solution for the homework. Understanding the cipher itself shouldn't present any problems, a Caesar cipher is quite possibly the simplest example available and it shouldn't take you more than a few minutes of Googling / reading to understand how it works. You could then solve a decrypt a ciphertext by hand, or using an online tool without any trouble.

If you do need to solve this programatically, then you may have to get studying. Learning to write code in Python will be a good starting point, although functionally speaking your code doesn't need to do an awful lot. For a string of text it'll be a matter of iterating over each character and performing the encryption / decryption process. If you get stuck, finding out how to reference individual characters in a string (by index), how to loop over each character in a string, how to reference a letter using a numerical value (think ASCII values for example) and how to wraparound when you get to the end of the alphabet (the modulus operation is useful here) should get you going. This might sound daunting, but it's a fairly trivial process even with no experience and sounds worse than it is. If you really struggle, look for examples of code, read through and understand how it works.
Reply 2
Original post by justanotherkayx
do you have to program a caesar cypher or just do it by hand?

Make a program that encrypts and decrypts a caesar cypher.
Reply 3
Original post by AcseI
So we can't possibly answer questions about what your teacher expects you to know, whether you were supposed to learn things beforehand, etc. You'll have to ask your course leader for that.

In terms of the problem at hand, it's unclear what you need to do. Are you expected to write your own program? Are you just expected to solve the cipher, and programming is one method that was recommended?

At it's core, the problem seems like it can be broken into two parts. Understanding the Caesar cipher, and coming up with a solution for the homework. Understanding the cipher itself shouldn't present any problems, a Caesar cipher is quite possibly the simplest example available and it shouldn't take you more than a few minutes of Googling / reading to understand how it works. You could then solve a decrypt a ciphertext by hand, or using an online tool without any trouble.

If you do need to solve this programatically, then you may have to get studying. Learning to write code in Python will be a good starting point, although functionally speaking your code doesn't need to do an awful lot. For a string of text it'll be a matter of iterating over each character and performing the encryption / decryption process. If you get stuck, finding out how to reference individual characters in a string (by index), how to loop over each character in a string, how to reference a letter using a numerical value (think ASCII values for example) and how to wraparound when you get to the end of the alphabet (the modulus operation is useful here) should get you going. This might sound daunting, but it's a fairly trivial process even with no experience and sounds worse than it is. If you really struggle, look for examples of code, read through and understand how it works.

So I'll have no choice to learn a whole programming language from scratch to complete one simple piece of work. That sucks considering that I thought they'd teach me that instead. I didnt do alot of programming in secondary so I'm confused on how I should learn it. Shall I just watch one of those 5 hour tutorial videos?
Reply 4
Original post by EchoesAct3
So I'll have no choice to learn a whole programming language from scratch to complete one simple piece of work. That sucks considering that I thought they'd teach me that instead. I didnt do alot of programming in secondary so I'm confused on how I should learn it. Shall I just watch one of those 5 hour tutorial videos?


That’s uni, you don’t get spoon-fed and have to do a lot of learning on your own.
Original post by EchoesAct3
So I'll have no choice to learn a whole programming language from scratch to complete one simple piece of work. That sucks considering that I thought they'd teach me that instead. I didnt do alot of programming in secondary so I'm confused on how I should learn it. Shall I just watch one of those 5 hour tutorial videos?

Assuming that's what you've been asked to do, yes to an extent. However you hardly need to learn an entire language from scratch. This program is not going to be particularly complex, so you won't need to know a ton to get it working.

I do agree that it's a little unusual for them to expect you to write code without giving any formal teaching on it first though. If prior knowledge were required you'd have been aware of that, and if no prior knowledge is expected then typically you'd be taught from scratch. So I can understand your frustration. It's probably worth reaching out to your lecturer and asking their advice, you probably aren't the only person in this situation. It's also fairly likely that if you're being asked to do this now, you'll no doubt be asked to write more complex programs later on. The sooner you start, the quicker you'll get to a point where you won't struggle.

In terms of how to learn, that's up to you. You could find a free online course, you could watch YouTube videos, you could buy a book, etc. Even if you didn't do a lot of programming in secondary school you probably have some foundational understanding for things like variables, loops, functions, etc. so you won't be starting completely from scratch. I'm also happy to point you in the right direction if you put in the effort yourself. For example you've done a little bit of programming and can do a quick Google to understand a Caesar Cipher. What do you know about how to write this program and what do you need to go and learn more about?
Reply 6
Original post by EchoesAct3
So I'll have no choice to learn a whole programming language from scratch to complete one simple piece of work. That sucks considering that I thought they'd teach me that instead. I didnt do alot of programming in secondary so I'm confused on how I should learn it. Shall I just watch one of those 5 hour tutorial videos?

What level are you working at? Have you just started a uni course having come from a school environment?

Were there any pre-requisites for the course in terms of programming knowledge? Did they give you any reading lists over the summer or ask you to complete any tasks in advance of joining the course?

As the previous poster said, I'd be very surprised if they just dropped you into a programming task without having already provided you with some programming material or made it clear in advance that you would be expected to know it!
I'd recommend finding a piece of code for a caeser cipher and finding out how it works as I find it easier to reverse engineer code if I don't know how to do something.
And I don't mean copy. I mean find some finished code and make something similar that you are comfortable with.
Reply 8
Original post by Bio 7
That’s uni, you don’t get spoon-fed and have to do a lot of learning on your own.

Sorry I shouldve mentioned that I was doing an a level not a course at uni. Sorry.
(edited 3 years ago)
Reply 9
T8

Original post by AcseI
Assuming that's what you've been asked to do, yes to an extent. However you hardly need to learn an entire language from scratch. This program is not going to be particularly complex, so you won't need to know a ton to get it working.

I do agree that it's a little unusual for them to expect you to write code without giving any formal teaching on it first though. If prior knowledge were required you'd have been aware of that, and if no prior knowledge is expected then typically you'd be taught from scratch. So I can understand your frustration. It's probably worth reaching out to your lecturer and asking their advice, you probably aren't the only person in this situation. It's also fairly likely that if you're being asked to do this now, you'll no doubt be asked to write more complex programs later on. The sooner you start, the quicker you'll get to a point where you won't struggle.

In terms of how to learn, that's up to you. You could find a free online course, you could watch YouTube videos, you could buy a book, etc. Even if you didn't do a lot of programming in secondary school you probably have some foundational understanding for things like variables, loops, functions, etc. so you won't be starting completely from scratch. I'm also happy to point you in the right direction if you put in the effort yourself. For example you've done a little bit of programming and can do a quick Google to understand a Caesar Cipher. What do you know about how to write this program and what do you need to go and learn more about?

I found out what a caesar cipher is and understand very well. As for the programming part I'm not so sure. I haven't taught myself any specific language so my knowledge of it all is pretty much bad. I'll just try to teach myself from scratch. I didnt do computer science in secondary so I guess I'll have to start from the very beginning.
Reply 10
Original post by davros
What level are you working at? Have you just started a uni course having come from a school environment?

Were there any pre-requisites for the course in terms of programming knowledge? Did they give you any reading lists over the summer or ask you to complete any tasks in advance of joining the course?

As the previous poster said, I'd be very surprised if they just dropped you into a programming task without having already provided you with some programming material or made it clear in advance that you would be expected to know it!

I've just started A levels and they didnt mention anything about knowing a programming language. Just a 7 in maths.
Reply 11
Original post by Rufus the red
I'd recommend finding a piece of code for a caeser cipher and finding out how it works as I find it easier to reverse engineer code if I don't know how to do something.
And I don't mean copy. I mean find some finished code and make something similar that you are comfortable with.

I'm pretty sure I'll get confused so I'd just stick to learning a language from scratch preferably python.
Original post by EchoesAct3
I found out what a caesar cipher is and understand very well. As for the programming part I'm not so sure. I haven't taught myself any specific language so my knowledge of it all is pretty much bad. I'll just try to teach myself from scratch. I didnt do computer science in secondary so I guess I'll have to start from the very beginning.

That, coupled with only being an A Level, makes it even more unusual that you'd just be told to do some programming with absolutely no prior learning. Definitely raise this with your tutor, this project isn't super difficult but it's not really suitable either. Definitely explain that you have no prior experience, ask where you're supposed to start, etc.

For the programming part, even if you don't know what code to write, do you have a rough idea of what the code needs to do? So for example could you describe the process involved? If so, you'll probably be able to get most of the way there with just a little introductory material covering variables and loops.
Original post by EchoesAct3
I'm pretty sure I'll get confused so I'd just stick to learning a language from scratch preferably python.

Fair enough and, yes, python is probably your best bet. :biggrin:
Original post by EchoesAct3
Make a program that encrypts and decrypts a caesar cypher.

Hey, so if you haven't done any programming languages yet maybe they expect you to write it in pseudocode which is basically just describing in words /plain language the steps of the algorithm (look it up and see some examples!) . If that's the case just research what a caesar cypher is and I think it would be really easy to just write some pseudocode. If they do expect you to code it, I really recommend the website Codecademy for good beginner-level coding lessons it's helped me out so much! Like others, I'd recommend python too. Hope that's helpful!
(edited 3 years ago)
Reply 15
Original post by AcseI
That, coupled with only being an A Level, makes it even more unusual that you'd just be told to do some programming with absolutely no prior learning. Definitely raise this with your tutor, this project isn't super difficult but it's not really suitable either. Definitely explain that you have no prior experience, ask where you're supposed to start, etc.

For the programming part, even if you don't know what code to write, do you have a rough idea of what the code needs to do? So for example could you describe the process involved? If so, you'll probably be able to get most of the way there with just a little introductory material covering variables and loops.

No I have no idea. I'll get there eventually. Thanks though.
Original post by EchoesAct3
No I have no idea. I'll get there eventually. Thanks though.

If you're unable to roughly describe how the code would work, then you may want to revisit the Caesar Cipher. If you can explain how you would solve a Caesar Cipher, that's the starting point for what you want your code to do. At it's most basic, fill in the blanks below:

The code will take ____________ as input, do ______________ to that input, then ouput _____________.

You can then work through those stages. For example you'd need somewhere to store the input (a variable), some way to output the result (a print statement) and whatever logic goes in the middle for the encryption/decryption process. This central logic will be the most complex part, but I think everything you'll need to know is mentioned in this thread. Good luck!!

Quick Reply

Latest

Trending

Trending