#Student needs quick help for his exam in Java

1 messages ยท Page 1 of 1 (latest)

glad gazelle
#

Hey, I need help for a Java exam, which is on tuesday. I watched some tutorials, but still need help. I kind of know already what they could ask me. You see it down below

Usage example

A customer such as DB Fernverkehr commissioned the implementation of a new software solution for monitoring trains during ongoing operation. For this, the software first needs to know the inventory of the vehicles, that is, the trains.

For the tool inventory that requires the following requirements, it is first necessary to develop a technical Java class model.

-> Each train is specifically either a long-distance train or a regional train, but other types may be added later
-> Each train consists of a locomotive and wagons, but how many there may be is not yet defined.
-> All components of a train must have an identification number, which can contain both numbers and letters
-> Every locomotive (or locomotive) has a drive. The possible drive types are fixed, i.e. a defined set of values.
-> Wagons are also of a specific type, such as passenger wagons or freight wagons. New species may be added here over time.

Part 1 (group work)

Create a small classroom model based on the information above

-> Classes: train, locomotive, wagon, long-distance train, regional train, passenger car, freight car
-> Attributes: id number (string), driver (enum)

Reference class model
link:diagrams/exam-classmodell-scenario-1.pum1[]

Part 2 (Theory and Knowledge)

In the context of the above task:

-> Questions...
-> Integration of abstract classes into the model if they are not included yet
-> Classes, attributes and their visibility
-> What kind of vibration collection can you use to manage trains and why
-> Options to filter trains (foreach+-if(), stream+foreach(), SQL- Where)

molten cedarBOT
#

<@&987246746478460948> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question ๐Ÿค–. Maybe it helps! In any case, a human is on the way ๐Ÿ‘. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#
TJ-Bot
Hey, I need help for a Java exam, which is on tuesday. I watched some tutorials, but still need help. I kind of know already what they could ask me. You see it down below Usage example A customer such as DB Fernverkehr commissioned the implementation of

hould focus on understanding the basics of Java programming, such as data types, variables, operators, loops, and conditional statements. Make sure you are familiar with the syntax and semantics of Java, as well as how to write and compile simple programs.

It's important to practice coding exercises and problems to solidify your understanding of the concepts. You can try solving problems on websites like LeetCode or HackerRank to improve your problem-solving skills.

Additionally, make sure you understand object-oriented programming principles such as classes, objects, inheritance, polymorphism, and encapsulation. These concepts are often tested in Java exams.

Lastly, review any specific topics that you think might be covered in the exam. This could include exceptions handling, input/output operations, or collections framework.

If you have any specific questions or need help with a particular topic, feel free to ask in the discord server. Good luck with your exam!

gusty raptor
#

And what's your question?

glad gazelle
#

So, I need to create classes related to the case above.

short viper
#

ok and what is stopping you as of right now?

uneven oxide
#

paste it in chat gpt

#

it should spit out the code with explanation ๐Ÿ˜Ž

short viper
#

thats not helpful

#

and not learning

#

even with explanation its not really learning

uneven oxide
#

hu

#

h

short viper
#

more spoonfeeding

uneven oxide
#

bruh

#

ok then do what u know and use fourms to help you fix probelm

#

๐Ÿ‘

glad gazelle
#

I have no idea where to start. The exam has 2 parts. 1. part is a group work with 2 other students, where we need to discuss how to do these things.

  1. part is about the knowledge in java. They will ask me things about Classes, attributes, abstract classes?, which collection I could use to manage trains, and some filter system
glad gazelle
gusty raptor
#

That's really not a good answer Splash, they should learn the fundamentals to be able to do the exam themselves.

uneven oxide
#

but prolly not good long term

#

my bad

short viper
#

you dont have access to chatgpt in exams

#

so its not really helpful

uneven oxide
gusty raptor
uneven oxide
#

ok

glad gazelle
uneven oxide
#

welp rip

gusty raptor
glad gazelle
#

what I understand from the text is, that we have 2 different types of trains. We got long-distance trains and a regional one

gusty raptor
#

In case you course material is lackluster you can check out:

uneven oxide
#

i dont think its possible to learn that much in 2 days

molten cedarBOT
#

MOOC is a completely free introductory Java course created by the University of Helsinki, it is a great way to learn Java from the ground up.

It consists of two parts, one at beginner, and another at intermediate level. The end of the course is marked by creating your own Asteroids game clone!

Even though the instructions show how to configure and use NetBeans for the course, you can use IntelliJ. To use IntelliJ, simply install the TMC plugin by opening IntelliJ -> File -> Settings -> Plugins and searching for TMC. You will then be able to use IntelliJ to complete MOOC.

Visit MOOC here: https://java-programming.mooc.fi/
(the course is available in both English and Finnish)

About the course - Java Programming

short viper
#

but in that case start earlier ๐Ÿคทโ€โ™‚๏ธ

gusty raptor
#

You can get a lot done, either way it's not a helpful answer.

glad gazelle
uneven oxide
#

read this should help part 1

short viper
#

that website is kinda meh though

uneven oxide
#

i learnt from w3schools xd

#

it didnt give technical stuff

glad gazelle
#

w3schools is good for the basics yes

uneven oxide
#

just how to do the concept

#

yeah

uneven oxide
#

it doesnt seem complicated

glad gazelle
#

the chance is high that the exact same case will be asked in our exam, since the one I posted is from the previous class

#

Maybe I can copy and paste the solution, if some experienced java developers can help me to solve it

uneven oxide
#

Create a small classroom model based on the information above

-> Classes: train, locomotive, wagon, long-distance train, regional train, passenger car, freight car
-> Attributes: id number (string), driver (enum)

short viper
#

Create a small classroom model based on the information above

-> Classes: train, locomotive, wagon, long-distance train, regional train, passenger car, freight car
-> Attributes: id number (string), driver (enum)
what do they mean by small classroom model?

glad gazelle
#

class model

uneven oxide
#

class Model?

short viper
#

ok yeah

uneven oxide
#

with that info used in there?

glad gazelle
#

i translated it from german to english

short viper
#

lmao

gusty raptor
uneven oxide
#

must Model be a class

short viper
glad gazelle
uneven oxide
glad gazelle
#

I wrote an exchange calculator

glad gazelle
short viper
uneven oxide
#

i was gonna say take some hours off sleep

#

and study java

#

๐Ÿ˜ˆ

#

but 6 isnt that much

glad gazelle
#

I can sleep, after the exams

short viper
glad gazelle
#

Yes

short viper
#

so what is stopping you?

#

I dont get it

glad gazelle
#

Lemme try to explain

short viper
#

hard to help that way

gusty raptor
#

Please take a look at the course I linked, it will better explain what you need to do. @uneven oxide please stick to relevant, helpful input.

glad gazelle
# short viper so what is stopping you?

I dont have the experience to solve it from my own, I need more time to study Java and in 2 days It wont be enough. thats why I said, it might be better to get help from someone experienced, who do it with me, so I can study this case only and know what to say, if I get asked

gusty raptor
#

Try to start writing what you can, and we can review what you wrote.

#

We're not a code writing service, but we can guide you based upon what you wrote.

glad gazelle
#

actually, we dont need to write the whole programm at all

short viper
#

that makes it easier

glad gazelle
#

We just need to tell how we would start and how we would do it

uneven oxide
#

@glad gazelle -> Classes: train, locomotive, wagon, long-distance train, regional train, passenger car, freight car -> Attributes: id number (string), driver (enum)for this do all of these classes need to have the same attributes

glad gazelle
#

okay, so the attributes would be strings?

uneven oxide
#

no i ment

#

like for each vechile

#

does it need the same attributes

glad gazelle
#

at this moment, there are only 2 vehicles. a long distance train and a regional train

uneven oxide
#

ok nice

#

what data types do they store?

glad gazelle
#

they both probably should contain passengers, distances etc.

uneven oxide
#

string id & driver?

#

hmm ok

#

like max distance

#

& min distance

#

?

main bison
#

i'd suggest u both read the assigment again :p

uneven oxide
#

what info about he passengers?

glad gazelle
#

each train consists of a locomotive and waggons, but its not defined how many waggons. But each train needs to have 1 locomotive

glad gazelle
main bison
#

Each train consists of a locomotive and wagons, but how many there may be is not yet defined.
-> All components of a train must have an identification number, which can contain both numbers and letters

uneven oxide
#

Part 1 (group work)

Create a small classroom model based on the information above

-> Classes: train, locomotive, wagon, long-distance train, regional train, passenger car, freight car
-> Attributes: id number (string), driver (enum)

Reference class model
link:diagrams/exam-classmodell-scenario-1.pum1[]

#

huh

main bison
#

dont assume things, know what's on the assigment

uneven oxide
#

i didnt see that

#

wtf

main bison
#

that's because u went gung ho on suggesting gpt etc ๐Ÿ˜‰

#

Wagons are also of a specific type, such as passenger wagons or freight wagons. New species may be added here over time.

uneven oxide
#

i read part 1

#

not above that

main bison
#

so u got 2 type's of classes, each with different versions

uneven oxide
glad gazelle
#

Yeah so, in the end, the software needs to know the inventory of the vehicles. We need to develop a java class model for it

#

-> Each train is specifically either a long-distance train or a regional train, but other types may be added later
-> Each train consists of a locomotive and wagons, but how many there may be is not yet defined.
-> All components of a train must have an identification number, which can contain both numbers and letters
-> Every locomotive (or locomotive) has a drive. The possible drive types are fixed, i.e. a defined set of values.
-> Wagons are also of a specific type, such as passenger wagons or freight wagons. New species may be added here over time

#

these are the requirements

uneven oxide
#

hm ok

glad gazelle
main bison
#

same with wagon

#

what your looking at is a basic inheritence / composition excerscise

uneven oxide
#

so you need to create alot of objects that will be inherited into an train class

main bison
#

Regional extends Train, LongDistance extends Train

uneven oxide
#

yeah

main bison
#

passeger / freight / whatever extends wagon

uneven oxide
#

๐Ÿ˜ตโ€๐Ÿ’ซ

main bison
#

Directly covers your next part

#

-> New species may be added here over time

uneven oxide
#

it isnt hard its just alot of stuff to do

glad gazelle
uneven oxide
#

https://www.w3schools.com/java/java_inheritance.asp this is very relevant please i think

main bison
#

it all comes down to reading

#

like the engine, that's composition

uneven oxide
#

thing

#

but yours needs more objects

main bison
#

also , if i see correct u do not even need code

uneven oxide
#

huh

glad gazelle
#

what does the extend mean? is it like: wagon contains the attributes: passenger, freight ?

uneven oxide
glad gazelle
main bison
#

its just the design he needs @uneven oxide , its clearly stated in the assigment

uneven oxide
#

oh

short viper
glad gazelle
#

there is even a reference classmodel link, but I got no idea how to open the link

#

link:diagrams/exam-classmodell-scenario-1.pum1[]

uneven oxide
#

or what

glad gazelle
#

No, its the link to a uml of the classmodel

main bison
#

probably some online diagram builder

glad gazelle
#

can I open it in IntelliJ?

uneven oxide
#

i ment how are u reading that msg

#

send screenshot

main bison
#

righto, keep forgetting that one exist. << StarUml fanatic :p

gusty raptor
glad gazelle
#

its from github I guess

uneven oxide
#

oh

short viper
#

then its in the github repository ig

uneven oxide
#

he probably made a format error

main bison
#

if u cant open it, its just text then if its plant

glad gazelle
#

not wokring

short viper
glad gazelle
#

yes

uneven oxide
#

did you replace repo with the actual repo

short viper
#

the file should be in there

glad gazelle
#

But he makes a new repository for each class,

uneven oxide
#

he made a formatting error

#

๐Ÿ˜ก

glad gazelle
#

there are 2 diagrams, but not the one from this case

uneven oxide
#

@glad gazelle what is the repo called

short viper
glad gazelle
#

Oh wait I found smth

#

there is a exam preparation folder

#

he took another example there.

main bison
#

The example posted is not that hard to design, just have to read carefully and not skim to fast

glad gazelle
#

so How should i create that java class modell

main bison
#

start with the main class and then the subclasses

#

by the time u have drawn those 2, some idea's will start to form on how to handle it

glad gazelle
#

The main class inherits to subclass right?

main bison
#

And as your limited to methods and access aswell due to your course, try to stay within limits

#

the main class is the one that manages the trains in total

#

which has composition of the other classes or collections and / or interfaces

#

on the main program there's no real info given so u need to wing it a few methods

#

the main details given are on the trains themselve so make sure that part is defined in a way it can be extended

glad gazelle
#

hmmmm