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

 Write a method that receives elapsed time for an event in seconds as a parameter. The method then displays the elapsed time in hours, minutes, and seconds. For example, if the elapsed time is 9630 seconds, then the method will display is 2:40:30. Write a main() method that will prompt a user for elapsed time for an event in seconds, and use received value to demonstrate that the method works correctly


PS: Imagine you are the salesperson in the supermarket and arranging the apples based on their size (in kgms) every day. One fine day, you decided to scan all the apples size and arrange it in less time than ever before. The scanner measured the apple’s size, for example, Apple 1 = 1.4 kgms and 1 kgms, Apple 2 = 1.8 kgms and 2 kgms. This made you arrange two patterns: Pattern 1 – apple size measured in float, Pattern 2 – apple size measured in integer. Design a C++ program to implement this given use case?

 Write a method that receives elapsed time for an event in seconds as a parameter. The method then displays the elapsed time in hours, minutes, and seconds. For example, if the elapsed time is 9630 seconds, then the method will display is 2:40:30. Write a main() method that will prompt a user for elapsed time for an event in seconds, and use received value to demonstrate that the method works correctly


Write a program using copy constructor to copy data of an object to another object.


Create a class called 'TIME' that has three integer data members for hours, minutes and

seconds, a constructor to initialize the object to some constant value, member function to

add two TIME objects, member function to display time in HH:MM:SS format. Write a main function to create two TIME objects, add them and display the result in HH:MM:SS format.


Create a 'DISTANCE' class with the following members:

Data Members

b) feet and inches

Member Functions

d) To input distance through constructor

e) To output distance

f) To add two distance objects

Write a main        function to create objects of DISTANCE class. Input two distances (one through

implicit call and other explicit call and output the sum. 


Write a program to perform addition of two complex numbers using constructor overloading.

The first constructor which takes no argument is used to create objects which are not initialized, second which takes one argument is used to initialize real and imaginary parts to equal values and third which takes two argument is used to initialize real and imaginary to two different values.


Write a program to perform addition of two complex numbers using constructor. Complex numbers are given through user input.


Create a class which stores name, roll number and total marks for a student.Input the data for a student and display it.


Surname Score
1. Sam Williams 60
2. John Phoenix 85
3. Simon Johnson 75
4. Sarah Khosa 81
5. Mat Jackson 38
6. Nick Roberts 26
7. Isaac Wayne 74
8. Anna Mishima 34
9. Daniel Rose 64
10. Aaron Black 83
11. Jack Mohamed 27
12. Kathrine Bruckner 42
Create a C++ program that has 3 Stacks.
Insert, into the first stack, all the data above (which is the data of student’s names,
surnames and the marks they obtain in a particular assessment)
Display the content of the stack on the screen (console)
Then, remove all the students whose surname starts with the alphabets ‘R’, ‘J’ and
‘M’, from the first stack and insert them into the second Stack.
Display the contents of Stack1 and Stack2.
Finally, remove all the students whose marks are less than 50 from both Stack1
and Stack2 and insert them into the Third Stack.
Display the contents of all the 3 Stacks. (30)
LATEST TUTORIALS
APPROVED BY CLIENTS