• Post Reply Bookmark Topic Watch Topic
  • New Topic

will this work?  RSS feed

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all, im after a push in the right direction please. ive tried to write out a programme in english as best i can so that i can get the general idea across.
so, will this work, if not what do I need to change or add? thanks in advance.

public class scrim

main method args

Welcome to SCRIM

A programme designed to help identify cars

Main menu

Select a number and press Enter.
Press 0 and Enter at any time to reset the programme.

call to method size
call to method colour
call to method registration
call to method identifying marks
call to method make
call to method file select

method size
First, to help identify a car, select the size.
using ArrayList with integers 1,2,3,4
1. hatchback
2. saloon
3. estate
4. van

user inputs a single choice e.g.; 1

a new array list is created from the user input called userAnswer

arrayList userAnswer (1)

method colour
to help identify a car, select the colour.
using ArrayList with integers 1,2,3,4
1. black
2. red
3. green
4. blue
arrayList userAnswer (1from method size),3) so after each question an integer is being added to the array list

this is repeated for the remaining methods. then the programme collates the answers and calls
method file select

using array list userAnswer with, for example answers, ArrayList userAnswer (1,3,4,5,2)
files xyz.text. abc.text, ugh.text etc are presented and then the user selects file abc.text as it is the correct file and can read the data.

am i along the right tracks to making this work? my main areas of concern are the array list being updated after each answer and then being able to select a possible group of files.
as far as the actual data is concerned with the files, im more after being able to make the concept work and im just using the cars as a way of testing.
 
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Downham wrote:am i along the right tracks to making this work? my main areas of concern are the array list being updated after each answer and then being able to select a possible group of files.

I think so, but I feel you're getting a bit too bogged down in the detail at the moment.
1. You shouldn't care about whether it's an ArrayList or not; it's simply a List. You can decide what type of List to use later on.
2. I suspect that you'll want to compile these answers into some sort of Selection object.
3. I think you might want to include an "ANY" answer to some or all of your questions.
4. I suspect that your "questions" should be in a single method, and you just supply it with whatever List of answers it allows.

HIH

Winston
 
John Downham
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I think so, but I feel you're getting a bit too bogged down in the detail at the moment.
1. You shouldn't care about whether it's an ArrayList or not; it's simply a List. You can decide what type of List to use later on.
2. I suspect that you'll want to compile these answers into some sort of Selection object.
3. I think you might want to include an "ANY" answer to some or all of your questions.
4. I suspect that your "questions" should be in a single method, and you just supply it with whatever List of answers it allows.

do you mean the the entire programme in one method or just the questions part?

and the "ANY" answer, what would that be for? to provide a greater possibility of files?

thanks.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Downham wrote:do you mean the the entire programme in one method or just the questions part?

The latter. It's almost always WRONG to put an entire program in one method.

and the "ANY" answer, what would that be for? to provide a greater possibility of files?

Presumably. To my mind, if you're answering the question "What colour?", it just means "any old colour".

BTW: You don't have to copy a post when you're responding. Just use the "Quote" button.

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!