The maximum height reached by a ball thrown with an initial velocity, v, in meters/sec, at an angle of θ is given by this formula:
height = (.5 × v2 × sin2 θ) / 9.8
Using this formula, write, compile, and run a C++ program that determines and displays the maximum height reached when the ball is thrown at 5 mph at an angle of 60 degrees. (Hint: Make sure to convert the initial velocity into the correct units. There are 1609 meters in a mile.) Calculate the maximum height manually, and verify the result your program produces. After verifying that your program works correctly, use it to determine the height reached by a ball thrown at 7 mph at an angle of 45 degrees.
Write a function that replaces the elements of an integer sequence whose value a is the value of b. Write a main program that uses that function and displays the resulting sequence of numbers on the screen. (Example: for the integer sequence 1, 2, 5, 2, 6, 7, 8, 12. Replace the numbers with the value 2 with the number with the value of 9, then we get the result sequence 1, 9, 5, 9, 6, 7, 8, 12)
Defines a struct that describes a point in 2D space. The values of coordinates and coordinates are floats.
Write a function that calculates the distance of any 2 points
Write a function that changes the coordinates of a point.
Write a main program using the above functions.
You are required to build a class to represent the a cup of coffee. Call your class
CoffeeCup. A coffee cup will have following characteristics
1. type (sting) // can be mocha, cupaccino, etc
2. temperature (float):
3. volume (float):
4. sugar (int):
Provide these methods
1. parameterized constructor CoffeeCup(string t, float temp float vol, int sug)
2. Provide setters for temperature, and sugar and volume.
3. Provide getters of temperature, sugar, volume and type.
4. void heatUp():
5. void cooldown(): the process of cooling down. The temperature goes down by one degree but
will not go below 0
6. bool isSweet():
7. bool hasMore():
8. bool isEmpty():
9. bool takeASip():
10. Provide a method print, that displays the status of the cup with respect to all data members.
In C++ Make a class CoffeeCup. A coffee cup will have following characters: type (string): mocha, cupaccino, etc. Temperature (float): represents the measure of temperature in degrees. Volume (float):volume of coffee in the cup in ml. Sugar (int): no. of teaspoons of sugar added to coffee. Provide parameterized constructor CoffeeCup(string t, float temp float vol, int sug). Provide setters & getters of temperature, sugar, volume and type. bool hasMore(): this method checks if the cup has coffee in it that a person can take a sip from. Assume that one sip consumes a volume of 0.3 ml. So do some calculations in this method to check if it has any sips left depending upon the volume available. bool isEmpty(): returns true if a person can take a sip from this cup and false otherwise. bool takeASip(): this method represents the actual act of sipping. One sip is taken i.e. the volume equivalent to one sip is taken away. Provide a method print, that displays the status of the cup with respect to all data members
Have the user input 5 numbers and outputs witch numbers are prime
Use the functions char toUpper(char) to check if a char is a lowercase alphabetic value. If it is, return the uppercase equivalent. If it isn’t, return the original char.
Assignment: Functions
void printBanner() – This function should open the file “banner.txt” in the same directory as the program, and print it’s contents to the terminal. It does not depend on any other functions.