Newbie Coders Chat

Announcements Posted on
Calling all anime fans! Don't miss the midnight Secret Santa deadline! 04-12-2016
How helpful is our apprenticeship zone? Have your say with our short survey 02-12-2016
    Offline

    3
    ReputationRep:
    (Original post by 571122)
    Remove 'public' from lines 12 and 13 and add the 'public' keyword before line 10.
    Your
    Code:
    public static void main
    should always be public.
    When i remove that parameter, i get all of the error messages i posted in message 209, so i think i would like to keep it in thanks.
    Offline

    2
    ReputationRep:
    (Original post by john2054)
    When i remove that parameter, i get all of the error messages i posted in message 209, so i think i would like to keep it in thanks.
    It's not a parameter, but an access modifier. The explanation for why you can't have the 'public' keyword inside a method is beyond technical for what we're doing here.

    However, there must be something you're doing that I'm not, because I just ran your code myself and it works perfectly. See here:
    http://pastebin.com/KKaVFHnH
    Offline

    2
    ReputationRep:
    Coding in Python because CS GCSE.
    I also code Lua, because I make exploits for roblox, (and get paid).

    But currently i'm trying to learn C# for Unity3D.
    Offline

    2
    ReputationRep:
    (Original post by john2054)
    Can you please pastebin the code you are using, so i can see if it works on my machine?
    Well, I just did, in the post you just quoted.
    Offline

    3
    ReputationRep:
    (Original post by 571122)
    Well, I just did, in the post you just quoted.
    Test Failed: One return statement
    Test Failed: Two return statements
    Test Failed: Two output statements in main method
    Test Failed: goodShoes is called from the main method
    Test Failed: badShoes is called from them main method
    Test Failed: Correct output: goodShoes
    Test Failed: Correct output: badShoes
    Completion: 6/11

    This is where it fails, if that is any help?
    Offline

    2
    ReputationRep:
    (Original post by john2054)
    Test Failed: One return statement
    Test Failed: Two return statements
    Test Failed: Two output statements in main method
    Test Failed: goodShoes is called from the main method
    Test Failed: badShoes is called from them main method
    Test Failed: Correct output: goodShoes
    Test Failed: Correct output: badShoes
    Completion: 6/11

    This is where it fails, if that is any help?
    You guys are doing Test-First Development? Man, that is an advanced practice and out of place for beginner programmers..

    I would have to see all of your tests (all the code) to be able to judge it.
    Offline

    3
    ReputationRep:
    (Original post by 571122)
    You guys are doing Test-First Development? Man, that is an advanced practice and out of place for beginner programmers..

    I would have to see all of your tests (all the code) to be able to judge it.
    It's okay 57, i'm now scraping a 50% pass for this unit, and whilst i would have have liked for more, a pass, is a pass, is a pass, as they say!
    Offline

    3
    ReputationRep:
    (Original post by 571122)
    You guys are doing Test-First Development? Man, that is an advanced practice and out of place for beginner programmers..

    I would have to see all of your tests (all the code) to be able to judge it.
    Plus seeing as i have been programming for only two weeks or less, i am still a beginner, just with good internetting skills! And good friends to help me out.

    I will let you know my grade for these programs when i get the feedback on mondey/tuesday.
    Offline

    2
    ReputationRep:
    (Original post by john2054)
    It's okay 57, i'm now scraping a 50% pass for this unit, and whilst i would have have liked for more, a pass, is a pass, is a pass, as they say!
    You know, John, I used to think that until senior year. It goes like this:

    - you passed, you know 50%-60% of the matter
    - second year comes along, you know 20%-30% of the matter
    - senior year comes along, you know 0%-10% of the matter
    - graduation: whatever you passed you now forgot

    That's the situation I'm in; I graduated and I forgot almost everything I studied for. Remember to keep it practical: passing is good. Keep passing until you get your degree, but don't forget to sharpen your skills once in a while.
    Offline

    2
    ReputationRep:
    (Original post by john2054)
    Plus seeing as i have been programming for only two weeks or less, i am still a beginner, just with good internetting skills! And good friends to help me out.

    I will let you know my grade for these programs when i get the feedback on mondey/tuesday.
    Ok, but be aware that if you guys are doing Test-First development and none of your tests pass, that's the same as saying the program doesn't work.. and there is a high likelihood of 0 marks, if the professor is a Testing purist (which almost all of them are..).
    Offline

    2
    ReputationRep:
    I'll be expecting all the code of your tests on pastebin. Thanks.

    See you around!
    Offline

    3
    ReputationRep:
    (Original post by 571122)
    Ok, but be aware that if you guys are doing Test-First development and none of your tests pass, that's the same as saying the program doesn't work.. and there is a high likelihood of 0 marks, if the professor is a Testing purist (which almost all of them are..).
    57, it appears to all work automatically. And whilst i tried the program out a week ago, it was failing on all points, now while i try it out it scores 7 out of 13, so just under 50%. Which whilst not ideal, is still a pass (or just under). And seeing as my other program scores are currently about 50% which is in itself half of the overall grade, and my other none coding criateria (quizes etc) are about 80%, i should be able to scrape the 50% overall.

    I may be new to coding, but i know my way around software games and degrees, having got one, so i think i should be alright. I will let you know as i said already.
    • Thread Starter
    Online

    3
    ReputationRep:
    No surprise that JavaScript is harder than CSS/HTML, but the Codecademy tutorial I've started out with is really annoying me :hmpf: And it's hit my motivation to keep going. There's nothing that bugs me more when I'm trying to learn than not knowing why I'm doing the task I'm doing....
    So for some reason, the Codecademy course gets me first to use "SomeWord".length in order to produce a number, and then write code based on that number, e.g. conditions and so forth. I understand all that, but why am I working out the number of characters in a word for every example? Is this used a lot normally? Why didn't it give me examples to explain why I'd want to do that. Using my own imagination it's hard to grasp why that would be such a common feature to use :confused:

    :sigh:
    Offline

    3
    ReputationRep:
    (Original post by Craghyrax)
    No surprise that JavaScript is harder than CSS/HTML, but the Codecademy tutorial I've started out with is really annoying me :hmpf: And it's hit my motivation to keep going. There's nothing that bugs me more when I'm trying to learn than not knowing why I'm doing the task I'm doing....
    So for some reason, the Codecademy course gets me first to use "SomeWord".length in order to produce a number, and then write code based on that number, e.g. conditions and so forth. I understand all that, but why am I working out the number of characters in a word for every example? Is this used a lot normally? Why didn't it give me examples to explain why I'd want to do that. Using my own imagination it's hard to grasp why that would be such a common feature to use :confused:

    :sigh:
    I would assume it's just an example of how variables can be handled. Checking string length has various uses, too (I've had to use it several times in ProjectEuler), so it's not too far fetched, thus it makes sense that it would be used as an example. I would also say that JS is significantly harder than HTML/CSS, because it is an actual programming language as opposed to a markup language.
    Offline

    2
    ReputationRep:
    (Original post by Craghyrax)
    No surprise that JavaScript is harder than CSS/HTML, but the Codecademy tutorial I've started out with is really annoying me :hmpf: And it's hit my motivation to keep going. There's nothing that bugs me more when I'm trying to learn than not knowing why I'm doing the task I'm doing....
    So for some reason, the Codecademy course gets me first to use "SomeWord".length in order to produce a number, and then write code based on that number, e.g. conditions and so forth. I understand all that, but why am I working out the number of characters in a word for every example? Is this used a lot normally? Why didn't it give me examples to explain why I'd want to do that. Using my own imagination it's hard to grasp why that would be such a common feature to use :confused:

    :sigh:
    Data-driven apps use word manipulation a lot. For example, looking for all the words that have at least 5 letters in them, or between 1 and 3 letters. You could then build up a frequency table with accompanying graph, showing the distribution of most frequently typed words in the human language or in text messages.
    Offline

    3
    ReputationRep:
    (Original post by Craghyrax)
    No surprise that JavaScript is harder than CSS/HTML, but the Codecademy tutorial I've started out with is really annoying me :hmpf: And it's hit my motivation to keep going. There's nothing that bugs me more when I'm trying to learn than not knowing why I'm doing the task I'm doing....
    So for some reason, the Codecademy course gets me first to use "SomeWord".length in order to produce a number, and then write code based on that number, e.g. conditions and so forth. I understand all that, but why am I working out the number of characters in a word for every example? Is this used a lot normally? Why didn't it give me examples to explain why I'd want to do that. Using my own imagination it's hard to grasp why that would be such a common feature to use :confused:

    :sigh:
    In the real world youd likely use it for figuring out the number of items in an array.

    For example if you fetched a list of customers from the web server. Those customers have likely been deserialised into an array on the javascript side.

    You may then want to display each customers name but to do that you'd need to know how many customers are in the array. So for that we can use length property.
    Code:
    for(var i = 0; i<customers.length;i++)
           //Add a <li> containing customer name
    Offline

    2
    ReputationRep:
    More examples from the real world:
    Form field validation: user fills out form (e.g. to subscribe to a forum) and the nickname field has to have a character length between 3 and 50 characters. We don't want mysterious empty names!
    Offline

    3
    ReputationRep:
    (Original post by john2054)
    57, it appears to all work automatically. And whilst i tried the program out a week ago, it was failing on all points, now while i try it out it scores 7 out of 13, so just under 50%. Which whilst not ideal, is still a pass (or just under). And seeing as my other program scores are currently about 50% which is in itself half of the overall grade, and my other none coding criateria (quizes etc) are about 80%, i should be able to scrape the 50% overall.

    I may be new to coding, but i know my way around software games and degrees, having got one, so i think i should be alright. I will let you know as i said already.
    Aww come on you got to aim high 100%. Prof will want to see your running the tests and them failing, then how you modified it to make it pass. Then for the bonus you 'refactor' the code to improve it then re-run the tests to see that your code still works.

    Don't worry about the refactor bit but at least make all the tests pass!
    Always aim as high as you can at uni that way if you dont achieve it your still at 80% :P
    Offline

    2
    ReputationRep:
    (Original post by INTit)
    Aww come on you got to aim high 100%. Prof will want to see your running the tests and them failing, then how you modified it to make it pass. Then for the bonus you 'refactor' the code to improve it then re-run the tests to see that your code still works.

    Don't worry about the refactor bit but at least make all the tests pass!
    Always aim as high as you can at uni that way if you dont achieve it your still at 80% :P
    What the heck? Why are you telling me these basics all over? I've done TDD for my entire educational career, it's nothing new to me. This is like someone telling me how to read.

    Maybe you meant this answer to be for John.
    Offline

    3
    ReputationRep:
    (Original post by INTit)
    Aww come on you got to aim high 100%. Prof will want to see your running the tests and them failing, then how you modified it to make it pass. Then for the bonus you 'refactor' the code to improve it then re-run the tests to see that your code still works.

    Don't worry about the refactor bit but at least make all the tests pass!
    Always aim as high as you can at uni that way if you dont achieve it your still at 80% :P
    (Original post by 571122)
    What the heck? Why are you telling me these basics all over? I've done TDD for my entire educational career, it's nothing new to me. This is like someone telling me how to read.

    Maybe you meant this answer to be for John.
    To be honest with you i am getting tired and frustrated with this course. They claimed to be able for complete beginners to do it, but i have been struggling, and without google and social media, tsr, i wouldn't stand a chance at all. This isn't an undergraduate degree i am doing in computer science, but just an online certificate, and whilst i am finding it interesting, and learning some thing or two about the thing, i am still struggling. And i don't know if i have it in me to complete the four or five module series, seeing as there is also a psychology certificate program i want to get my teeth in to as well. Not to mention the voluntary work i am looking at starting in the near future.

    I got 60% for my degree, which was a 2.1 pass (b grade), and i was very happy with this. I started this computer science course, mainly because my dad wanted me to, but now he won't even read over my code, so to be honest with you i am left asking, is it worth it. I have an interview on tuesday morning, and my wedding anniversary meal tomorrow, so it's not as if i don't have stuff to be doing?!?
 
 
 
Write a reply… Reply
Submit reply

Register

Thanks for posting! You just need to create an account in order to submit the post
  1. this can't be left blank
    that username has been taken, please choose another Forgotten your password?
  2. this can't be left blank
    this email is already registered. Forgotten your password?
  3. this can't be left blank

    6 characters or longer with both numbers and letters is safer

  4. this can't be left empty
    your full birthday is required
  1. Oops, you need to agree to our Ts&Cs to register
  2. Slide to join now Processing…

Updated: November 25, 2016
TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

Today on TSR
Poll
Would you rather have...?
Useful resources

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Quick reply
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.