Class trouble
I'm currently learning how to work with classes for Object Oriented Programming, and for some reason, I am getting this error for creating a smartphone and laptop despite having declared them in the classes part.






23 Replies
Error is pretty clear, no?
The required parameter
brand
is not set. You only set the modelhm?
hmmmmm?
assuming
textBox1.Text
is the modeltextbox 1 is supposed to be where the user inputs the brand and the mod, am I supposed to have 2 textboxes or something?
Ah okay, this was info I didn't know about
So how is this done then? How does a user input both?
Two textboxes sound better here unless you want the headache of figuring out which part is which
if you want i can screenshot the whole thing?
It would help if you just $paste the code
If your code is too long, you can post to https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code!
Anyway the thing here is that
textBox1.Text
occupies the first parameter and the second paramete ris left unset. You need to consider how you pass the second parameter.BlazeBin - hlydggpzcukl
A tool for sharing your source code with the world!
It's starting to make sense, but I'm still lost...
sorry...
You probably just want a second text box, the same way you made the first one
oh ok
thanks!
I think I'm doing it wrong

what parameters does a
Smartphone
needjust the model and the brand
exactly
same for the laptop
now, you only provide one
and thus VS is giving you an error
Let's say you get Model from textBox1.Text and Brand from textBox2.Text, in this case your code should look like this;
oh, thanks!
yep everything works now
thanks for the help!
Np, theese are basic things about classes, highly recommend watching a >5 min video to catch up, you'll understand the concept pretty quickly. Good luck