Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

le El History Bookmarks Help Project-Csci 123. Content-C ent 3pdf ntent-rid-4236

ID: 3779019 • Letter: L

Question

le El History Bookmarks Help Project-Csci 123. Content-C ent 3pdf ntent-rid-423601A9 1/ rses Csci 290 Section 1 MA 2016-2017 FALL G All Blackboard Home Pa.. Spi open Tic.. SurveyMonkey Fr c... Citrie secure Sign In L Assignments-Cs 3.lf there are no vowels, add "ay", so Pig-latin for "RP is "RPMay" M" Question 3: Write a recursive function to computer the greatest common divisor (gcd) of two integers. The gcd of two integers is the largest integer that divides them both. A recursive definition of gcd is gcd(m, n n (if n divides m god(n, remainder of m divided by n) otherwise Question 4: The Game of Boggle: The object of game Boggle is to find as m any words as possible in a k by k grid of letters. Words may be formed from any sequence of 3 or more adjacentietters in the grid. The letters may be joined together horizontally or vertically or diagonally. No position in the grid may be used more than once within any one word. You may not wrap around the grid. The first line of the input is the integer k, followed by k lines with k characters per line For instance, a sample grid might look like: Ceta ftag Valid words that can be traced by this board involve fact, cat, face etc What your Program Should Do:Your program should be implemented in C Your program should read the dictionary from the file dictionary.txt ploaded it on lackboard). First of all, write a function that reads in the board and prints it out. Your program should read the Boggle board in the format specified above (the first line specifies the integer k, and the following k lines give the board) from a file board.txt(You can set your own file). Your program then read the words from dictionary.tst and store in some data structure like array, Finally, you should print all the words that it finds in the grid and print them out Hint: using recursion, recursive backtracking (similar to Sudoku) A 429 PM

Explanation / Answer

3) This program is completely as per the gcd definition provided in question

#include<iostream.h>
#include<conio.h>

int gcd(int m,int n);

void main()
{int m, n, div;
cout<<"Please enter first integer"<<endl;
cin>>m;
cout<<"Please enter the second integer"<<endl;
cin>>n
div = gcd(m,n);
}

//As per the definition provided in questions
int gcd(int m, int n)
{
if(n%m==0)
return n;

else
return gcd(n,m%n);
}
}