C++ Answers

Questions answered by Experts: 9 913

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

The science museum has asked you to write a c++ application that children can use to find the total number of hours and years slept during their lifetime. Assume they slept at an average of 8 hour per night. The user should enter the name, birthday, year and current year.

Name - Mercy

day - 01

year - 1999

Current year - 2021


To calculate the number of hours slept. Assume 365 day per year, 30 day per month and 8 hours of sleep per day. The program should show how many years, month, weeks, days, hours, minutes, seconds the child slept in this lifetime.

Note : use classes, function, and control structures to achieve this task. the user will also determine the number of children the process.


the science museum has asked you to write a c++ application that children can use to find the total number of hours and years slept during their lifetime. assume they slept at an average of 8 hour per night. the user should enter the name, birthday, year and current year. to calculate the number of hours slept. 365 day per year, 30 day per month and 8 hours of sleep per day. the program should show how many years, month, weeks, days, hours, minutes, seconds the child slept in this lifetime. note use classes, function, and control structures to achieve this task. the user will also determine the number of children the process


The MUSEUM has asked you to write a C++ applicationt that children can use to find the total number of hours and years slept during their lifetime. Assume they slept at an average of 8 hour per night. the user should enter the name, birthday, year and current year. To calculate the number of hours slept. 365 day per year, 30 day per month and 8 hours of sleep per day. The program should show how many years, month, weeks, days, hours, minutes, seconds the child slept in this lifetime


How we can access the private and protected members of class in other class or function without using inheritance. Write Example of Weight class which has two private data members kg and gram.There is a nonmember function AddTen() which object of weight class and adds the values ten to kg and gram.


Create a file called "DATA" to store the set of integer elements. Search whether the given element is present or not within the file. If the element is present, then write the factors of that searching element in the "FACTORS" file. Write a formatted IO file program to demonstrate the above operation and display the contents of "FACTORS" file.
Create a class called Person that has three private data members name, age and height and the

following public member functions: • Default constructor - To initialize the data members

Parameterized constructor - To initialize it to the given values

.getInput() - To get the person details from the user showOutput() A constant member function to display the person details. Names.

should be left justified and age and height to be right justified

isTaller() - A constant member function that takes a constant person object as parameter and compares the height of the person object which calls this function with the height of the person object that is passed as parameter and returns true if the calling object is taller than passed argument; otherwise returns false; Write a main function to create an array of 3 Person objects and find the tallest person. Display all the persons details and print the details of the tallest person.
How we can access the private and protected members of class in other class or function without using inheritance. Write Example of Weight class which has two private data members kg and gram.There is a nonmember function AddTen() which object of weight class and adds the values ten to kg and gram.
What is name of class which has only pure virtual functions and how it can be used to implement important concept of object oriented programming called polymorphism. Elaborate with example of shape class having functions draw() and calculateArea().Inherit the Circle, Rectangle and Triangle classes from shape class.
Assume there is an array having 20 different shapes objects. How to draw all of the in single loop
Add to the time class hat has separate int member data for hours, minutes, and Seconds the ability to subtract two time values using the overloaded (-) operator, and to multiply a time value by a number of type float, using the overloaded (*) operator.
Define a class called Point that contains two data members: x and y of float type. Define constructors to initialize the data members. Define a friend function to calculate distance between two point objects. Declare a class DArray which has data member size to store the size of the array, and element - a pointer to point class type. Define 1-arg. constructor that takes size as parameter and allocates memory dynamically to element of given size. Also define destructor to release the memory. Overload [] operator that takes the index position as parameter to manipulate (store/retrieve) the required element in the array. In main create an object of DArray to hold 3 objects of Point type and find the distance between every pair of points.
LATEST TUTORIALS
APPROVED BY CLIENTS