Questions: 11 448

Answers by our Experts: 10 707

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 & Filtering

c++ program to get two integers from the user x,y and calculate x power y using recursion and pointers


Write a program to input a year and find out that the year is leap year or not.

write a program that computes the average value of an array and prints the difference between each value and the average value you have just computed let the maximum number of items in the array be 8


Chess Game Knight’s travails.

You are required to do the following:

1. Explain how you can ensure that any move do not go off the board.

2. Choosing a search algorithm for finding the shortest path for the knight’s travails.

3. Defend your choice of an appropriate search algorithm to find the best possible

move from the starting square to the ending square.

4. Creating a script for a board game and a knight.

5. Create a diagrammatical tree structure, to illustrate all possible moves of the

knight as children in the tree structure

Hint:

Develop a data structure similar to binary trees. Using a standard 8 X 8 chessboard, show the knight’s movements in a game. As you may know, a knight’s basic move in chess is two forward steps and one sidestep. Facing in any direction and given enough turns, it can move from any square on the board to any other square. 



Explain at least not less than five differences between data-oriented programming and 

object-oriented programming. In your explanations, include concepts of data-oriented 

design, object-oriented design, and use at least five examples which should include 

source codes to support your arguments.



Type two statements that use rand() to print 2 random integers between (and including) 100 and 149. End with a newline. Ex:
101
133
Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activity. Also, srand() has already been called; do not call srand() again.

#include <cstdlib> // Enables use of rand()
#include <ctime> // Enables use of time()
using namespace std;

int main() {
int seedVal;
cin >> seedVal;
srand(seedVal);

/* Your solution goes here */

return 0;
}
Define a class called Point that contains two data members: x and y of float type. Define constructors to initialize the data members. Define a friend function to calculate distance between two point objects. Declare a class DArray which has data member size to store the size of the array, and element - a pointer to point class type. Define 1-arg. constructor that takes size as parameter and allocates memory dynamically to element of given size. Also define destructor to release the memory. Overload [] operator that takes the index position as parameter to manipulate (store/retrieve) the required element in the array. In main create an object of DArray to hold 3 objects of Point type and find the distance between every pair of points.
Create a class called Person that has three private data members name, age and height and the
following public member functions:
• Default constructor – To initialize the data members
• Parameterized constructor – To initialize it to the given values
• getInput() - To get the person details from the user
• showOutput() - A constant member function to display the person details. Names
should be left justified and age and height to be right justified
isTaller() - A constant member function that takes a constant person object as parameter and
compares the height of the person object which calls this function with the height of the person
object that is passed as parameter and returns true if the calling object is taller than passed
argument; otherwise returns false; Write a main function to create an array of 3 Person objects
and find the tallest person. Display all the persons details and print the details of the tallest
person.

Write a c++ program to generate a dynamic multiplication table allow the user to specify the following;

-The type of multiplication table 

-The starting point 

-The ending point

// 2 * 2 = 1

// 2 * 10 = 10




  1. Develop a program to display the multiplication table for any numbers key in by the user, define the loop to display the multiplication process in a function.
  2. Define a function to find out the minimum, maximum, and mean values in the array of 10 numbers.
LATEST TUTORIALS
APPROVED BY CLIENTS