Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Design four classes: Student, Exam ,Sports and Result.  The Student class has data members such as reg. number, name. Create Exam by inheriting the Student. The Exam class adds data members representing the marks scored in 3 subjects. Create Sports by inheriting the Student. The Sports class adds data members representing the marks scored in indoor and outdoor games. Derive the Result from the Exam , Sports and Result  has its own data member of Total mark. Write an interactive program with appropriate member functions to model this relationship.


write a c++ program to create a class called date that has separate member data for day month year one constructor should initialize 

this data to 0 and another should initialize it to fixed values .another member function should display it The final member function 

should add two objects of type date passed as arguments. A main() program should create two initialized date objects(among these one 

should contain today's date andanother one should contain your date of birth) and one that isn’t initialized. Then it should compare 

the two initialized values together, leaving the result in the third date variable. Finally it should display the value of this 

third variable. Make appropriate member functions const.


write a program for conversion from decimal to binary ,octal and hexadecimal .the program should be developed as follows:


(a).the base class convert has two variables initial and result in which initial is a number before conversion and result is 

after conversion.


(b). it has two member functions getinit() and getconv() which return the initial value and converted value respectively.


(c). write a function compute which is a pure virtual function that actually does the conversion.


(d). separate derived classes for hexadecimal ,binary, octal, does the conversion by implementing the function compute.


(e). create the objects for each class using new operator.


(f). use the convert class type pointer to call the compute functions of the derived classes


Design a Job class with three data fields-Job number, time in hours to complete the Job, and per-hour rate charged for the Job.


Include overloaded extraction and insertion operators that get and display a Job's values.


Include overloaded + and - operators that return integers that indicate the total time for two Jobs, and indicate the difference in time between two Jobs, respectively.


Write a main()function demonstrating that all the functions work correctly.


Create a Person class that includes fields for last name, first name, and zip code. Include a default constructor that initializes last name, first name, and zip code to “X” if no arguments are supplied. Also include a display function. Write a main()function that instantiates and displays two Person objects: one that uses the default values, and one for which you supply your own values. Save the file as Person.cpp. Y


Write a program having Classes Rectangle with data members’ length and width, Square with data member side ,EquilatralTrainglewith data member side . All these classes are derived from class Shape. Write an independent function which will exhibit polymorphism and show the area of the object passed to the function. All data members of class are private; you can write suitable functions needed for you.

Input six names from text file and use if (s1>s2) then swap to sort 5 names (use string library)


1-   Input six names from text file and use strcomp and strcopy functions to sort 5 names (use cstring libtrary)

 

Where strcmp and strcpy are the followings:

  

strcomp(s1,s2): return 0 if s1 == s2

                         return positive number if s1>s2

                         return negative number if s1<s2

strcpy(s1,s2):   s1=s2


Using vector class library, read 12 numbers from a file and push into a vector “vect1”. Write the following functions:

      1- Swap the first element in the list with the min value .

      2- Swap the last element in the list with the max value

      3- Return the median.


Use a structure called Time to write a C++ program that asks the user to enter a time value in hours, minutes, and seconds. The program should then print out the total number of seconds represented by this time value.


LATEST TUTORIALS
APPROVED BY CLIENTS