Help with school project (netbeans)

Discussion in 'Programming' started by guy12345, Jul 10, 2018.

  1. So i'm being forced to take a class of programming in school idk why but I am. Thing is that even if I don't like it I still know how to do everything we've seen and have been getting good grades until now that we got a project coming up and I've tried with what we've seen in classes but I don't feel it's enough and I've asked the teacher and he says that with what we've seen it's enough so after googling programming forums I found this one and hope i'm putting this in the right forum.

    So pretty much what I need to do is a Gas station where it asks for the person's name and then they have to select what type of gas they want (3 types their name don't matter) once they do that the program will ask them how many litters do they want to buy and with whatever each of the 3 types of gas cost it'll tell the total amount that it'll cost to buy that much gas. After that happens they would be asked if they want to go over the process again and if they click yes it'll ask what type of gas again and everything goes again and once they hit no in if they want to do it again it'll say a message of the total price of the gas like of all of the liters in total that the user entered and the price. All of this needs to be done through JOptionPanes comboboxes or message boxes.

    I do know how to do some of it but there's other things I don't know how to do and because I don't I can't really do that ones I know. So this is why I hope I can get some help! Thanks! Sorry for my english i'm not from the US.
     
  2. Which are the things you don't know how to do?
     
  3. I do know the process and how everything needs to go in order I just don't know how to make it. I don't know if you understand me. I have an idea of what could be done for each thing but when I do it it doesn't work. Also something I can't seem to do at all is making it so when they select one of the 3 gas types that it follows the process and asks them if they want to repeat and if they hit yes they will be asked again for the gas type.
     
  4. MiniDigger

    Supporter

    when tackling a development project, split the work up in many small parts and then do them one by one.
    so the first part could be asking the person for its name using a JOptionPane. so write a main class, open the pane with the question, get the answer and print it out into the console. do you know how to do that?
    once you got that, do the next step. the selction of the type of gas. open a pane again, get the answer, print it out. then, next step, check if the answer is valid.
    just like that, you come closer and closer to the end.
    if you get stuck on a step, we are happy to help you. just explain what your current step is, the issue you faced and your current code, then somebody can take a look and give hints.
     
  5. Thanks, I will do that.
     
  6. It's hard to tell what's going wrong without seeing a code. Did you manage to solve this program? I have similar task to do my java homework but on the ticket vendor machine for public transport with different types of tickets. I do not understand in what small parts I should split the work up.