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

Program in c++


create a node for binary tree. you are required to create 2 projects



1. only binary tree



2. binary search tree



perform the operations for



1. constructor



is empty



isFull



hasLeft



hasRight



2. insert (remember insertion in Binary tree is different from insertion in binary search tree)



search in BT and BST



-BFS



-DFS

Write a function that determines who has won a game of tic-tac-toe. The function should receive a character array containing the moves of tic-tac-toe game as given below. first check all rows to see whether one player occupies all the cells in one row, next check all columns, and then check the two diagonals. The function should return a value of 1, 0, -1 in case player 1 wins, draw and player 2 wins, respectively. Assume player 1 marks ‘o’ and player 2 marks ‘x’. Assume, the position for no-move contains ‘ ’ (space character). 



Declare and define the necessary function to calculate pension, growth salary, income tax, total deduction, and net salary of an employee when it is called and return a value to the caller.




Hint:




The program is expected to Input basic salary, allowance and credit association as an input and displays basic salary, allowance, credit association, growth salary, pension, income tax, total deduction and net payment as an output.




Employee earn additional money as allowance monthly (different values of allowance).




Employee must pay money monthly as a credit association (different values of credit association)




Pension=(BasicSalary*.07) when it is called and return a value to the main function ()




GrowthSalary=(BasicSalary +allowance) when a function is called and return avalue to the caller.




TotalDeduction=(Pension+IncomeTax+ CreditAssociation) when a function is called and return a value.




NetPay=(GrowthSalary-TotalDeduction) when it is called and return a value to the main program



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.

LATEST TUTORIALS
APPROVED BY CLIENTS