OOP Build a House (Assignment) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 15

OOP Build a House (Assignment)

Hey im intrested in seeing some nice examples (the right way if there is one 🤔 ) of OOP using classes, Class will be called building in which you would build the house from. The house show the following when run feel free to use your own values. House address: 123 Java Road. Bedrooms: 3 Connectivity: True Gardens: 2 Parking: Garage Value: £120,000 Thanks 😀👍

25th May 2018, 8:18 PM
D_Stark
D_Stark - avatar
21 Answers
+ 28
I hope to see a right way...☺️ Till then,... My try 👇 [Ruby OOP] https://code.sololearn.com/cbRh8EL5kF29/?ref=app
26th May 2018, 11:14 AM
🌛DT🌜
🌛DT🌜 - avatar
+ 13
https://code.sololearn.com/c2df2GB1JU0h/?ref=app
1st Jun 2018, 8:08 AM
LukArToDo
LukArToDo - avatar
+ 9
Apple Blossom thats intresting does each class have its own main?
25th May 2018, 8:52 PM
D_Stark
D_Stark - avatar
+ 8
Nice idea D_Stark here is my submission https://code.sololearn.com/c9964enag76E/?ref=app
26th May 2018, 8:38 AM
Shahil Ahmed
Shahil Ahmed - avatar
+ 8
Thought i would try this again as i wasnt happy with my previous attempt 😊👍. https://code.sololearn.com/cRuClRlWwDS8/?ref=app
30th May 2018, 3:17 PM
D_Stark
D_Stark - avatar
+ 8
Similar to Puny Programmer but with Function Prototypes. Edit: Added a few features. https://code.sololearn.com/WyivINOv54gZ/?ref=app
5th Jul 2018, 10:23 AM
luʁi
+ 7
This sounds like a real estate app. I've created one for houses using only Main Driver class as GUI.
25th May 2018, 8:43 PM
Apple Blossom
Apple Blossom - avatar
27th May 2018, 2:02 AM
luʁi
+ 5
this probably isn't the "right way" (although imo if it works it's the right way haha) but here you go https://code.sololearn.com/c2zyp9Qxj70i/?ref=app
25th May 2018, 9:06 PM
hinanawi
hinanawi - avatar
+ 5
I had two classes actually, the driver and the external class but I slimmed down the code to only use the driver. It's a small GUI and has some extra features in it. I mainly used an ArrayList Object for the data and a blend of File Reader/Buffer for the input from users. The rest is methods and GUI NODES. Preview is below. https://ibb.co/mzibfo
26th May 2018, 5:45 PM
Apple Blossom
Apple Blossom - avatar
27th May 2018, 2:52 PM
🐙evil octopus
🐙evil octopus - avatar
+ 5
16th Jun 2018, 9:34 AM
luʁi
30th May 2018, 3:26 PM
bedawang
bedawang - avatar
28th Jul 2018, 3:35 AM
luʁi
+ 3
here's another one (slightly more sophisticated than my try in C): https://code.sololearn.com/cPAZ5Nj5OIMm/?ref=app
28th May 2018, 10:23 AM
🐙evil octopus
🐙evil octopus - avatar
+ 3
reserved for my code
8th Jun 2018, 4:43 PM
Seniru
Seniru - avatar
+ 2
Black Rose works for me
16th Jun 2018, 8:16 AM
hinanawi
hinanawi - avatar
+ 2
Doll i know rookie mistake
16th Jun 2018, 9:42 AM
Black Rose
Black Rose - avatar
0
https://code.sololearn.com/cy2bE61f7ScT/#py This works in my notebook but not on here can someone tell me why?
16th Jun 2018, 2:05 AM
Black Rose
Black Rose - avatar