• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

How do I convert this to a program. thanks.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How would I convert this into a program. It's actually for my sixth grade science class but I want to have a program to go along with my model. My dad said I should use JOptionpane but I don't know what that is. thanks for any help. Please don't answer if you aren't going to help thank you.

Environment: In an environment where it snows frequently during the winter, and rains frequently during the spring. Most people are going to work or school during 6:00am to 10:00am, and coming home during 4:00pm to 6:00pm. At noon there is a lunch rush.

Season:
Spring = 3
Summer=1
Fall=1
Winter=5

Time:
6:00am to 10:00am: 5
9:00am to 11:00am: 2
12:00pm: 4
12:00pm to 3:00pm: 1
3:00pm to 6:00pm: 5
6:00pm to 9:00pm: 2
9:00pm to 12:00pm: 2
Make a program that adds up the numbers of both the season and time. If the output is
2, 3, or 4: Print Traffic is Low
5, 6, 7: Print Traffic is Medium
8, 9, 10: Print Traffic High
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A JOptionPane can be used to show alert messages. It is not really relevant for your problem. Do you have the logic implemented?
If you do what is the problem and if not what is the problem?
 
Ranch Hand
Posts: 479
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You would have to accept the season and the time as parameters to your 'program'. Based on this input you will then compute the intensity of traffic. This needs to be the processing logic for the program you develop.

Next you would have to take a call on how you intend the application/program to be viewed/accessed. If you want a graphic user interface, JOptionPane would be an option. Another way would be from Command Prompt without using any graphical components.

How you 'execute' this program again would have to be decided. You can write a Batch/Shell script for execution or create an executable (this would not be Platform independent).

 
Addie Mustapha
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, I wrote all this out, I just don't know how I would make it into java
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then take these steps:

Take some paper and a pencil with a big gum.
Write down the steps you need to perform to get to the desired result (how you do this mentally).
Convert the steps to Java code.

We are willing to help but we're NotACodeMill.
 
lowercase baba
Posts: 13091
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Generally speaking, we can't do much with "how do I do this" questions - they are too broad for anyone to really attempt to answer. Some of the immediate things that I would ask you include:

1) Do you have the JDK installed?
2) Do you know how to compile and run a java program?
3) Have you done so for a "hello, world" program?
4) Have you started this project yet? If so, what have you written? Can you post your code here for us to see?
5) What - SPECIFICALLY - do you need help with? The GUI? The logic? The Data model?

Nobody here will write the program for you. If you make an effort, you will be AMAZED at how much help you will get from strangers, but you have to make some effort yourself.
 
reply
    Bookmark Topic Watch Topic
  • New Topic