Expected outputMountain1 10 treesDam1 area 1800 Volume 3600Capacity 3.6Total dam 1Your Program OutputEnter mountain name: Enter number of trees: Enter dam name: Enter length of dam: Enter width of dam: Enter depth of dam: 2 0 trees area -516635904Volume -144902144Capacity -144902Total dam 1
Question
Expected outputMountain1 10 treesDam1 area 1800 Volume 3600Capacity 3.6Total dam 1Your Program OutputEnter mountain name: Enter number of trees: Enter dam name: Enter length of dam: Enter width of dam: Enter depth of dam: 2 0 trees area -516635904Volume -144902144Capacity -144902Total dam 1
Solution
I'm sorry, but you didn't provide a specific text for me to respond to. Could you please provide more details?
Similar Questions
Input2Mountain110Dam12090Expected outputMountain1 10 treesDam1 area 1800 Volume 3600Capacity 3.6Total dam 1Your Program Output2 0 trees area -1253137408Volume -1473544192Capacity -1.47354e+06Total dam
Write a C++ program Create a base class Mountain with protected data members: mountain name and number of trees.Define a constructor to read the data members. Create a class Coast from Mountain with a static data member to represent the total number of dams. Define a constructor to read the dam details such as dam name, total length, and width of the dam. Define member function “Display” to print the mountain details and the surface area of a dam.surface area of a dam=length*widthCreate a class Dam_detials from Coast with a private data member: depth. Create a parametrized constructor to initialize the value of depth. Define a member function “ Display” to calculate the capacity of your dam.Member function (Display) in Dam_details overrides the member function (Display) in the Coast classCapacity=Volume/1000Volume=Surface area*depthCreate required objects, base pointers and access the member functions. Identify the type of inheritance given.Sample Input5 (Read the depth )Mountain1 (Read the mountain name)20 (Read number of trees)Dam1 (Read dam name)30 (Read length)50(Read width)Sample OutputMountain1 20 treesDam1 area 1500Volume 6000Capacity 6.0Total dam 1
Problem statementsGiven a binary tree, find its height.Input FormatA single line of input contains string s which contains the node of the tree in level order fashion.'N' in the string represents NULL node.A string 5 1 1 2 N N 2 reprsents the tree 5 / \ 1 1 / \ 2 2Similarly a string 1 2 N 3 N represents the tree 1 / 2 / 3Constraints1 <= Number of nodes <= 10^51 <= Data of a node <= 10^5Output FormatPrint the height of the tree.Sample Input2 N 1 3 NSample Output3
The first line contains an integer , the number of nodes in the tree.Next line contains space separated integer where th integer denotes node[i].data.
int countNodes(TreeNode* root) { if (root==nullptr) return 0; int lh=findheightleft( root); int rh=findheightright( root); if (lh==rh) return (1<<lh)-1; return 1+countNodes(root->left)+countNodes(root->right);… int findheightright(TreeNode* node){ int height=0; while(node){ height++; node->right; } return height; }
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.