2 Replies - 2163 Views - Last Post: 06 December 2008 - 11:55 PM Rate Topic: -----

#1 sanjivani182  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 06-December 08

Write a C++ code for a class called Cars with member elements

Posted 06 December 2008 - 11:31 PM

MY QUE ARE
1 Write a C++ code for a class called Cars with member elements
 Wheels
 Engine
 Steering
 Stereo
And a member functions called gear( ), accelerator( ) and brakes( ), runs( )

3 In the class Cars (defined in question-2) initialize member elements Engine and Stereo with product-id using Constructors class and Destructor class. Explain when constructor and destructors are invoked respectively.


4 You have class Cars with you right? Can you inherit two classes called Hyundai and Maruthi-Suzuki with member elements specific to them and write codes showing those two classes.

5 For Cars Class, we have Maruthi-Suzuki and Hyundai as derived class. If Maruthi-Suzuki engine runs on Diesel and Hyundai on Petrol, implement runs( ) member functions and tell how it exhibits polymorphism?
for example1
#include<iostream.h>
#include<conio.h>
class cars
{

	int wheels,steering,stero;
	char engin[10];
public:void  gear();
	void accelarator();
	void breaks();
	void runs();
};


for 3
include<iostream.h>
#include<conio.h>
class cars
{

	int wheels,steering,stero;
	char engin[10];
public:void  gear();
	void accelarator();
	void breaks();
	void runs();
};
class hyundai:public cars
{
	char color[10];
	int price;
	void getdata();
};
class marutisuzuki:public cars
{
	int engin_cc,max_speed;
	void display();
}



PLZ SEND CODING FAST BECAUSE AFTER 2 DAY MY PRACTICAL EXAME START

This post has been edited by sanjivani182: 06 December 2008 - 11:50 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Write a C++ code for a class called Cars with member elements

#2 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5182
  • View blog
  • Posts: 26,886
  • Joined: 10-May 07

Re: Write a C++ code for a class called Cars with member elements

Posted 06 December 2008 - 11:33 PM

View Postsanjivani182, on 7 Dec, 2008 - 12:31 AM, said:

PLZ SEND CODING FAST BECAUSE AFTER 2 DAY MY PRACTICAL EXAME START


Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil  Icon User is offline

  • Toubabo Koomi
  • member icon

Reputation: 5182
  • View blog
  • Posts: 26,886
  • Joined: 10-May 07

Re: Write a C++ code for a class called Cars with member elements

Posted 06 December 2008 - 11:55 PM

Topic renamed to be a bit more descriptive.

Can you please tell us what you want help with? Is something wrong in your code?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1