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 C++ program to calculate the maximum height when the user gives the angle (in degrees). The given below is the equation to calculate the maximum height.




v = 10.568 (initial velocity), g = 9.8 (acceleration due to gravity), θ = angle of the initial velocity from horizontal plane in radians and H = maximum height

Note: Assign the above values for v, g and PI. Consider the g (acceleration due to gravity) is a constant.

  • User may insert an angle below 20° and above 10°.
  • Then the program should calculate the maximum height (H) for each angle only when the angle below 20°.
  • You are required to calculate the θ in radians by using the given formula (PI = 3.14286 which is a constant).  
  • Use the necessary header files to do the calculation

Create an Investment class that contains fields to hold the initial value of an investment, the current value, the profit (calculated as the difference between current value and initial value),and the percent profit (the profit divided by the initial value). Include a constructor that requires initial and current values and a display function. Create a House class that includes fields for street address and square feet, a constructor that requires values for both fields, and a display function. Create a HouseThatIsAnInvestment class that inherits from Investment and House. It includes a constructor and a display function that calls the display functions of the parents. Write a main()function that declares a HouseThatIsAnInvestment and displays its values.


Create a function to sort a unsorted singly linked list.
Note:
1)no global declarations are allowed
2) make class
with good examples explain how integer data types can be type- cast into real numeric data types and vice versa

Compile Time Polymorphism IV

Develop a program to overload binary operators.

The class Complex has the following public attributes

Data typeVariable nameintrealintimaginary

Include default constructor to initialize real and imaginary values to 0


Include the following functions in the Complex class and overload the binary operators

Member functionFunction descriptionvoid getvalue()This function is used to read .

void display()This function will display the result value

​​​​

 

Sample Input and Output :

[All texts in bold represents input and rest represents output statements]


Enter the value of Complex Numbers a,b :4 5

Enter the value of Complex Numbers a,b :7 8

Input Values :

Output Complex number : 4+5i

Output Complex number : 7+8i

Result :

Output Complex number : 11+13i

Output Complex number : -3-3i


Any four challenges faced while selecting program development tools


Write a program language that accepts the radius of a circle from the user and compute the area and circumference of the circle.
Write a C++ program to determine prime number within a certain range( choose your own range )
Write a C++ program to print numbers from 1-5

Consider the code snippet given below:-

[Assume the necessary header files and namespaces included]

int x=10;

int main()

{   int x=20;

{ int x=30;

     }

       return 0;

}

Include the ‘cout’ statements at appropriate places in the program to get the output

 10 20 30


LATEST TUTORIALS
APPROVED BY CLIENTS