Given three variables x, y, z write a function to circularly shift their values to right. In
shift y = 5, z = 8 and x = 10. Call the function with variables a, b, c to circularly shift
other words if x = 5, y = 8, z = 10 after circular shift y = 5, z = 8, x =10 after circular
values.
write a function which takes marks of student out of 100 as input and returns his grade pass/fail. Call this function into main() for 3 students
Create a class player and implement relevant member functions and member variables inside your class.
Create a class player and implement relevant member functions, member variables inside your class.
write a statement that declares a variable num of integer type as a constant having a value 5
Program in c++
Ali Raza is a frequent long distance driver. He wants to compute how much distance he covers over a number of days. Ali also wants to know the average distance travelled.
To perform this task you will need to create a class called distance. The class will contain the fuel price in liter and also the distance he has travelled. To find the average and the distance travelled you will need to overload two operators as follows:
+ operator to compute the total distance travelled.
/ operator to compute the average distance travelled.
In the main( ) you will create six objects and then you will write a single expression that will demonstrate the use of + and the / operator. Your expression should resemble the following:
obj1+obj2+obj3+obj4+obj5+obj6 / 6
VISION is a world leader in manufacturing LCD Televisions. The company has decided that it will allow its customers to give the dimensions of the TV (in length and width).Using in c++.
Create a class called vision
Create three constructors as follows:
A default constructor that calls the setlength( ) and setwidth( ) function.
A parameterized constructor that will receive the length and width as integers
A parameterized constructor that will receive the length and width in float
By using a special function calculate the area of the TV
Create a function to calculate the price of the TV by multiplying the area with Rs. 65.
Create a display( ) function to show the details of the purchased TV.
In the main you will construct three objects that demonstrate the use of the three constructors. After calling the constructor it will take over and will handover control to the area function, and then the price calculation function.
Write a program that helps teams in a league pick new players for the coming 2021 season. League has a total of 4 teams where each team can have a maximum of 16 players.
1. Get the number of players to enlist in the draft and store their information For a batsman bowling average and strike rate should be set to -1, and vice virsa.
2.Reorganize the player information on the basis of their expertise. Only allocate memory required to store players’ data separately (batsman bowler and allrounder).
3 Assign ranking on the basis of random number
4.To calculate how many new players each team can buy in the draft.
5.Each team will be asked to tell the number of players they want to retain out of 16. R cannot be less than 7 and greater than 11.
6.New players they can have will be total players minus the players they want to retain (16 – R)
7.Player selection function where each team chooses their pick one by one. Once a player is picked by a team change his status to false
by CodeChum Admin
There are different kinds of numbers, but among them all, the most commonly used numbers in our daily lives are those positive ones. So, I only want you to count all the positive numbers from the 4 outputted values and print out the result.
Go and search for the positive ones among these four!
Calculate the unit of electricity consumed by a customer with the conditions stated below and print it a bill form.
1. For 1st 100 units @ RM 1/unit.
2. For next 100 units @ RM 2/unit.
3. For next 100 units @ RM 3/unit.
4. For next 200 units @ RM 4 /unit.
5. For next units @ RM 5/unit.
6. Tax to be added in final amount @ 10%.
7. Meter charge RM 50. extra. Construct the necessary script to solve the given problem.
Construct the necessary script to solve the given problem – Print The bill