#assignment help, again

1 messages · Page 1 of 1 (latest)

ocean ore
#

My program works fine without the class but teacher likes to be annoying. I cant figure out how im suppose to put a different class inside of this one. Iv tried supering book and making book class its own parameter

dusk garnetBOT
#

This post has been reserved for your question.

Hey @ocean ore! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

coarse spade
#

What do you mean? Be specific

ocean ore
#

Booklisting makes the price of the book. It has 2 parameters

#

Thats the main class

coarse spade
#

"My program works fine without the class" => what do you mean?
"teacher likes to be annoying" => what do you mean?
"Iv tried [...] making book class its own parameter" => what do you mean?
And in theory you should have explained everything else, but I guess the main class explains it better

#

Is the main class something that you're forced to use as it is?

ocean ore
#

yes

#

book as well

#

In main the book listing news have two parameters but i cant figure out how you make an already existing book a parameter for book listing

coarse spade
#

Do you know how to make an already existing String a parameter for Book?

ocean ore
#

i tried that and it said you cant make the book class into a string

coarse spade
#

I didn't ask whether you tried something

#

I asked whether you know how to make an already existing String a parameter for Book

ocean ore
#

book is another one that int being changed

#

i ca only change book listing

coarse spade
#

I didn't ask what you can change

#

I asked whether you know how to make an already existing String a parameter for Book

ocean ore
#

yes i do

#

it doesnt work

coarse spade
#

I didn't ask whether something works

#

If you say you know, then please show

ocean ore
#

im not changing book

#

its perfect as is

coarse spade
#

So what you're saying is that no you don't know

#

So, here is how you make an already existing String a parameter for Book:

#
String title = "Frankestein";
String author = "Maty Shelley";
Book book1 = new Book(title, author);
ocean ore
#

I already said the book class is not being changed

#

its book listing that is causing issues

coarse spade
#

Because nothing here implies changing Book

ocean ore
#

all of that is already done

#

i know how it works

#

im trying to get that into book listing to use it

coarse spade
#

It works the same with BookListing, so no you don't know how it works

#

As a Book takes two parameters of type String and String

#

A BookListing takes two parameters of type Book and double

#

That is all

ocean ore
#

it wont let me use type book

coarse spade
#

What do you mean?

ocean ore
#

it doesnt work, it just gives errors

coarse spade
#

What - do - you - mean?

ocean ore
#

that making book a parameter doesnt work

coarse spade
#

What do you mean?

ocean ore
#

making book a parameter in book listing creates an error

coarse spade
#

Stop using fancy words

#

"making book a parameter" => What's that?

#

In other words, don't say anything but what you mean

ocean ore
#

i give up this is pointless. ill just wait until tomorrow for my teacher