0

Cout term

why does the following does not display? cout<<root->get_furniture_type;(line 101) https://code.sololearn.com/cOQkLlfgDJpo/?ref=app

3rd Aug 2018, 10:00 PM
DerpyCoco
DerpyCoco - avatar
5 Respuestas
+ 1
DerpyCoco I checked and managed to get output from your code with minor update... my input was C B As it's c and b, you are settling bookcase as 100 through set value method... this indicate that weight is 100. now coming to your add function, getweight will give you 100, but your condtion check that weight should be less than 75, total should be less than or equal to 300 for vehicle type as C.. 100 makes this condition fail and code block inside if does not work (hence furniture is not set )... I just changed getweight() < 75 to getweight() < 150 and I got answer... this change is at line 79 in your code... to conclude, check your condition to setnext inline with your default values of getweight
4th Aug 2018, 3:45 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
0
thank you. I will like to display the list when the user decides to quit the program. my code will only display furniture weight nothing under them(think of a table or reciept).
4th Aug 2018, 4:15 AM
DerpyCoco
DerpyCoco - avatar
0
Truck can hold 950 pounds of cargo.  A Car can hold 300 pounds, but can't take any single item that is over 75 pounds.two pieces of Furniture this summer.  Bookcases weigh 100 pounds and Chairs weigh 40 pounds.
4th Aug 2018, 4:18 AM
DerpyCoco
DerpyCoco - avatar
0
DerpyCoco your code displays name of furniture and weight in two different line if I provide input as C B y C n note that all input on solo learn app need to be given in one go with space between them
4th Aug 2018, 4:19 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
0
to conclude, your code works fine... just check with input and your logic to add furniture inline with your ground base condition
4th Aug 2018, 4:21 AM
Ketan Lalcheta
Ketan Lalcheta - avatar