Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

how to assign 4 classes to each faculty member and delete the class that has been assigned?

Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The code below works but im trying to delete each class that has been assigned to each faculty member. Is there a easier way to assign the classes to each member and delete them?:

Posts: 1104
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

You have said that you are trying to delete each class assigned to a faculty. Have you already written that code? If so, post that code too. Tell us what you have tried and what doesn't work.

Also, you have posted this in JavaFX forum. I don't think this has anything to do with JavaFX. Please CarefullyChooseOneForum before posting the question.
I am moving this to the "Java in General" forum where such questions are answered better.

Also, please UseCodeTags when posting code.
Posts: 76479
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch (again)

I have applied the code button to your code and you can see how much better it looks. Please use that button in future. Unfortunately you have mixed tabs and spaces for your indenting; you should set the options on your text editor to change tabs to spaces and only use spaces.

I am afraid I cannot see any faculty members, nor can I see classes. All I can see are Strings. You need a faculty member class, and a class class, which you must not call Class because there is already a Class class which represents classes.
Write a Teacher class and a Module class. The teacher class can have an array of up to 4 modules as a field. Give that Teacher class a toString() method. Find out how to use a for‑each loop (=enhanced for loop) and a StringBuilder object to put together the String for the toString method, because you don’t get a helpful output if you try to print an array with println. Forget about all the other methods for the time being; you can add them later. Test your Teacher class with a method like thisSame sort of thing for the Module class. Gradually add methods to the Teacher class. One method at a time. For each method, add a line to the TeacherDemo#start method which runs that method.
Can you smell this for me? I think this tiny ad smells like blueberry pie!
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic