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

Consider the code snippet given below:-

 [Assume the necessary header files and namespaces included]

int main()

{ int a[10];

 cout<<”enter the elements of the array\n”;

 for(int i=0;i<10;i++)

 cin>>a[i];

 

 

return 0;

}

 Complete the code such that the even and odd numbers from the array ‘a’ are stored into two different arrays. The size of these arrays should be same as that of the number of elements and their memory should be deallocated after displaying the odd and even numbers.


Class Template – Array

Write a C++ program to create a class template using an array. Perform operations like sorting, searching, and displaying the array using a class template.

A class named Array with the following member variables.

Data TypeVariable NameIntegersizeT*array



Function NameDescriptionvoid sorting()      This function is used to sort the array elements in ascending order and display the array.void search(T &search)                      This function is used to search the array element, if the element is found display "Element found at position x" else print "Element not found"

Sample Input and Output 1:

Menu

1.Sorting integer array

2.Searching array of double values

Enter your choice:

1

Enter size of array:

3

Enter the array elements:

5

2

55

Sorted array

2

5

55


Can you write a C++ program that compute the given formula below sqrt{A+C∗(D∗E) /(F+G) ∗ (H∗J)}-C and request user name before computation

Your horse has to have 1 ounce of probiotic supplement a day. You can buy it per


pound, as a 10 lb pail at a 10% discount, or as a 20 lb pail at a 15% discount. Your


goal is to produce formatted output showing the daily cost for each buying


option. You should ask the user to enter the price per lb.



Your horse has to have 1 ounce of probiotic supplement a day. You can buy it per


pound, as a 10 lb pail at a 10% discount, or as a 20 lb pail at a 15% discount. Your


goal is to produce formatted output showing the daily cost for each buying


option. You should ask the user to enter the price per



Write a program to calculate the number of objects created and destroyed for the
counter class.
Write a class marks with three data members to store three marks. Write three
member functions, set_marks() to input marks, sum() to calculate and return the sum
and avg() to calculate and return average marks.
Create a class named time, the data members are hours, minutes and seconds. Write a
function to read the data members supplied by the user, write a function to display the
data members in standard (24) hour and also in (12) hour format

Develop an OOP program to maintain a list of homework


assignments. When an assignment is assigned, add it to the list, and when it is


completed, remove it. You should keep track of the due date. Your program should


provide the following services:


• Add a new assignment.


• Remove an assignment.


• Provide a list of the assignments in the order they were assigned.


• Find the assignment(s) with the earliest due date.


create a class called assignments to complete the task and use STL to implement the


linked list. compile and run your project and test all the methods.



"Sqrt A+C*(D*E)-C\/(F+G)*(H*J)"

 Write a C++ program that compute the given formula below


LATEST TUTORIALS
APPROVED BY CLIENTS