Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Assignment Classes and Object

assignment

Uploaded by

AizaButt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Assignment Classes and Object

assignment

Uploaded by

AizaButt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1.

Write a program that will create a Class ‘Car’ and its fields like CarModel, CarName,
CarPrice and CarOwner. The program should include functions to assign values to the
above-mentioned fields and a display function to show the values

2. Print the average of three numbers by creating a class named 'Average' having a
method to calculate and print the average

3. Print the sum, difference and product of two complex numbers by creating a class
named 'Complex' with separate methods for each operation and numbers will be
passed while function calling through object
4. Write a program by creating an 'Employee' class having the following methods and
print the final salary of employee. 1 - 'getInfo()' this method will take (a) name of the
employee (b) hourly rate and (c) total working hours in a month as parameter and will
do assignment ‘printSalary()’ this method will print the emoloyee’s monthly salary
along with employee name

You might also like