Construct a class of fractions with both numerator and denominator being floats. Define the following functions in the class:
constructor
Operator functions for addition, subtraction, multiplication, and division of two fractions
Function input operator, output operator a fraction
Write a main program using the above fraction.
Construct the String class to describe a string of characters, with the following functions:
constructor, destructor, copy constructor, assignment operator function
Define operator to add two strings (concatenate two strings)
Functions that define comparison operations !=,==,>,>=,<,<=
Define input and output operators for a string
Functions that allow to assign/get (write/read) the value of a certain element in the Array
Write a main program using the above String class
by CodeChum Admin
I'm quite into games now, so how about we play In or Out! When a given number is even, the team scores so we shall print "In", but if it's not an even number, then we print "Out".
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
Write a class student to input students' scores and weights using a constructor. The program should
then calculate a weighted average and score based on the data inputted by the user
Write a class RootFinder to find the Fifth root of the sum of the squares of the first 100 ODD
numbers only
A new shop named Healthy Fruits has opened in a town, suppose they have hired you as a software engineer to make a program for them to store fruits names with prices lists, as well as for them to keep track of their sales. The program should display the following Menu to users.
1. Insert/Store Fruits names and prices
2. Display the fruit’s list (Fruit names with Prices)
3. Buy Fruits
4. Display the Sales/Bills of customers who have bought fruits
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