Giter Site home page Giter Site logo

Nitesh kumar's Projects

calculate-volume-of-water-tank icon calculate-volume-of-water-tank

Statement:Anil very well knows the power of object orientation so he wants to create a small program that can calculate the volume of a water tank. He knows, he can calculate the volume of any shape if the length L, width W and height H of that shape is known. But he also knows rather focusing on length, width and height if any one provides a water tank to his program still, he can calculate the volume using object-oriented way. In order to achieve his goal, he needs your help to create such program which should be smart enough to calculate the volume in following conditions. If any one gives only one number x to calculate the volume your program should treat L=B=H=x And calculate the volume. If any one gives only two numbers x and y to calculate the volume your program should treat L=B=x and H=y If any one gives three numbers x,y and z then treat 3 numbers as x=L, y=B and z=H respectively. Now interesting thing is if any one gives a WaterTank your program should able to find given water tank’s L B and H and calculate volume of it. to implement the above operations create a class Calculate and create function volume(<arguments>) inside that class, to calculate volume for all above cases and finally print the calculated volume in the volume(<arguments>)function only. in order to create the watertank object first design a class WaterTank which contains 3 private data members L B and H of type integer. class WaterTank contains following methods. first it contains a constructor, the constructor work is to accept three integers as argument and initialize instance variable L, B and H with these arguments. class WaterTank contains 3 more methods getLength(), getWidth() and getHeight() work of these functions is to return value of L, B and H respectively. for better understating we are providing you a code snippet, this code snippet contains a main() method and some statements. We have already written this code snippet in this program so there is no need to write main() method for this program. So your task is to just observer the code snippet and write the rest code (class creation) which is required for successful execution of the program. int main() { int x,y,z; //declaring three variables x,y and z denoting length, width and height respectively. int l,b,h;//declaring three variables l,b and h denoting length, width and height of WaterTank object respectively. cin>>x>>y>>z; //taking input in x, y and z denoting length, width and height of tank respectively. cin>>l>>b>>h;//taking input in l, b and h denoting length, width and height of WaterTank Object respectively. WaterTank w(l,b,h);//creating object w of WaterTank Calculate c;//creating object c of Calculate class c.volume(x);//should print the volume by assuming length=width=height=x c.volume(x,y); //should print the volume by assuming length=width=x and height=y c.volume(x,y,z);//should print the volume by assuming length=x, width=y and height=z c.volume(w);//should print the volume of watertank w. return 0; } Input:first line contains three integers x, y and z denoting length, width and height respectively. second line contains three integers l, b and h denoting length, width and height of watertank object respectively. Output:output contains four lines. first line contains an integer denoting volume by assuming length=width=height=x second line contains an integer denoting volume by assuming length=width=x and height=y third line contains an integer denoting volume by assuming length=x, width=y and height=z fourth line contains an integer denoting volume of watertank w. Constraint :1<=all variables<=50 don’t write main() method in your program, just complete the coding of class. include header files and use namespaces as per your requirement.

datasetsort-in-c- icon datasetsort-in-c-

Statement: write a c++ program such that it can sort the array in increasing and decreasing order using the operator. 1 ^β€œ+” to sort array in increasing order 2 ^β€œ-” to sort array in descending order. For this create a class named as DataSet which contains two private data members. First is integer pointer p to point dynamically created array and second one is integer variable n to store the size of dynamically created array. Class DataSet contains following methods First it contains a constructor which accepts an integer n as argument denoting size of dynamically created array. The constructor should create the array of size n dynamically, and also initialize that array with n integer values. Second it contains a print() method whose work is to print the elements of DataSet separated by space. suppose D1 is the DataSet so statement D1^"+" should sort the D1 in increasing order and statement D1^"-" should sort the D1 in decreasing order. for better understating we are providing you a code snippet, this code snippet contains a main() method and some statements. We have already written this code snippet in this program so there is no need to write main() method for this program. So your task is to just observer the code snippet and write the rest code (class creation) which is required for successful execution of the program. int main() { int n; //declare a variable n denoting size of dynamic array cin>>n;//taking input in integer n denoting size of dynamic array DataSet D1(n); //creating object of DataSet D1 D1.print(); //print the elements of DataSet D1 separated by space D1^β€œ+”; //sort the elements of DataSet D1 in increasing order D1.print();//should print the elements of DataSet D1 in increasing order separated by space D1^β€œ-”; //sort the elements of DataSet D1 in decreasing order D1.print();//should print the elements of DataSet D1 in decreasing order separated by space return 0; } Input : first line contains an integer n denoting size of dynamically created array. Second line contains n space separated integers denoting elements of array. Output: output contains three lines. First line contains n space separated integers denoting elements of DataSet D1 Second line contains n space separated integers denoting elements of DataSet D1 in increasing order Third line contains n space separated integers denoting elements of DataSet D1 in decreasing order. Constraints:5<=n<=10don't write the main() function for this program Example: 5 5 2 1 3 4 5 2 1 3 4 1 2 3 4 5 5 4 3 2 1

location_tracker icon location_tracker

In this model i have used markov ,folium module ,numpy ,plotly,etc to predict the future loaction of a person based on his previous location history

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.