In form of C++ class and objects, create a program with this problem:
Company ABC, an airline company is closely monitoring the distance between airplanes as they take-off on the same airport. You are asked to create a system that would calculate the distance between two planes A and B given the following plane attributes: Take-off Time, Speed (mi/hr), direction (north, east, west, south). Also, given the time where the navigation officer would like to check the distance.
IN THE FORM OF OBJECT ORIENTED PROGRAMMING, C++, CREATE A PROGRAM THAT COMPUTES THE AREA OF A GIVEN RECTANGLE, AREA OF A CIRCLE AND AREA OF A TRIANGLE.
In form of C++ class and objects, create a program with this problem:
Company ABC, an airline company is closely monitoring the distance between airplanes as they take-off on the same airport. You are asked to create a system that would calculate the distance between two planes A and B given the following plane attributes: Take-off Time, Speed (mi/hr), direction (north, east, west, south). Also, given the time where the navigation officer would like to check the distance.
IN THE FORM OF OBJECT ORIENTED PROGRAMMING, C++, CREATE A PROGRAM THAT COMPUTES THE AREA OF A GIVEN RECTANGLE, AREA OF A CIRCLE AND AREA OF A TRIANGLE.
Create a class CompundNumber having the following data members (real,
non-existence) and implement serializable. The class CompoundNumber also
should contain the constructor and method to read a complex number from user.
The program should throw an exception if non-existence is negative. Also
override toString() Method.
Create an abstract class Car (model, price). Include get and set methods
form these fields. The setPrice Method must be abstract.
Define a class Person with members name,age,gender and location type. Define another
class which is derived from Person named Salary with members basic,da and hra .Calculate
net salary of a person . HRA depends on the location type. Location type can be 'A','B',or 'C'.
For 'A' hra is 500, for 'B' hra is 1000, and for 'C' it is 1500.
Using class String -concatenate two names by operator overloading operator +
class String data members : name,length members functions : constructors ,print,additon
function
IN THE FORM OF OBJECT ORIENTED PROGRAMMING, CREATE A PROGRAM THAT COMPUTES THE AREA OF A GIVEN RECTANGLE, AREA OF A CIRCLE AND AREA OF A TRIANGLE.
Using C++ Inheritance, you need to create a game program using C++.
The game specifications are the following:
1. The user has 3 types of player against a monster.
Master:
Life = 10 Super
Power = Double attack (1 time)
Damage = Life to 0 if double attack was used
Healer:
Life = 10 Super
Power = Restore life of warrior (1 time)
Damage = attack / 2 if healing power was used
Warrior
Life = 10
No super power
2. Every attack of monster cause equal damage to player’s life. Deduct monster’s attack to player’s life
3. Effect of player attack to monster depends on how player attack
4. Player’s super power (master and healer) can only be used once throughout the game.
5. Player with 0 life is not allowed to attack
6. Monster has an initial life of 30
7. The game will continue until monster is defeated or all players are dead.
Required:
1. Use inheritance to create the program.
2. Display current life status in the given format (see testcase)
3. Ask user to choose a player ‘m’ for master, ‘h’ for healer and ‘w’ for warrior. If user selects master or healer, ask user if they want use the super power if yes, apply proper attack value to monster else perform a simple attack.
Note: They can only use each super power once. Current life = previous life – attack
4. Generate random number from 1 to 6 as the attack value of both players and monster.
Note: remove srand() on monster attack
5. At the end of a single round, display current status after the attack (see test case)
6. Player with zero life is not allowed to attack thus inform user to choose another player.
Note: if user selects dead player, the round will still be the same.
7. Use looping statement to generate rounds of the game. The program will only terminate if the total life of the team (life of master + life of Healer + life of warrior) is equal or less than zero thus, monster won the game or the life of monster is equal or less than zero.
8. Do not display negative life. If current life is less than 0 after the attack then display zero.