logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Logan AndressonPsychology
(5/5)

532 Answers

Hire Me
expert
Marius BantockGeneral article writing
(4/5)

861 Answers

Hire Me
expert
Santosh SaxenaComputer science
(5/5)

606 Answers

Hire Me
expert
Dawn FrenchComputer science
(4/5)

586 Answers

Hire Me
Java Programming

You must rotate a square matrix counter-clockwise or clockwise 90 degrees an arbitrary number of times. You will be given a matrix of integers that has equal height and width.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Rotate Matrix

You must rotate a square matrix counter-clockwise or clockwise 90 degrees an arbitrary number of times. You will be given a matrix of integers (otherwise known as a 2-dimensional array), that has equal height and width. The dimension can range from 2x2 - 10x10. You will also be given an integer that may range from -100 to 100, this integer will indicate which direction to rotate the matrix and how many times to rotate it. You are expected to return the rotated matrix.

direction - The number of rotations in a particular direction. If > 0 rotate the specified amount of times clockwise. else if < 0 rotate the specified amount of times counterclockwise. Otherwise, no rotations are expected.

matrix - A two-dimensional array of integers that is to be rotated.

returns -  The rotated matrix it was initially given.

int[][] rotateMatix(int direction, int[][] matrix)

 

Remove Nested Statements

When given a string, your job is to remove a substring that starts with a prefix and ends with a suffix pattern. The patterns may be nested within each other so you must remove the outer most pattern's found in the text. The length of the prefix and suffix will always match.

 

Example:

prefix = "{" suffix = "}" text ="{Hello} Bob"

expected output = " Bob"

prefix = "{" suffix = "}" text ="He{ll}o} Bob"

expected output = "Heo} Bob"

prefix = "{" suffix = "}" text ="H{e{ll}o} Bob"

expected output = "H Bob"

text - The string with the substring to be removed

prefix - A pattern that the substring must start with

suffix -  A pattern that the substring must end with

returns -  The given text with the substring removed

String removeNestedStatements(String text, String prefix, String suffix)

Count Occurrences

Count the number of times a given pattern is found in the string in the array of strings.

Example:

array = ["aba", "ckel",  "kealska"]

pattern = "a"

output = 4

array - An array of strings

pattern - A pattern you are attempting to find in the strings contained in the array

returns - The number of times the pattern is found in the strings in the array.

int countOccurances(String[] array, String pattern)

Merger and Remove

Given two arrays of integers. Your job is to combine them into a single array and remove any duplicates, finally return the merged array.

Example:

array_1 = [1,2,3]

array_2 = [2,3,4]

output = [1,2,3,4]

array_1 - An array of integers

array_2 - An array of integers

returns - An array of integers containing the unique values from both array_1 and array_2

int[] mergeAndRemove(int[] array_1, int[] array_2)

Morse Translator

You will be given a string in either morse code or normal English text. Your job is to translate the string to the opposite language. In other words, if the string you are given is English translate the string to morse code. Furthermore, if the string is morse code translate the string into English. To keep things simple, any English text you receive will not contain any "." or "-". Please refer to this link to find the character translations.

Example:

input = "Hello"

output = ".... . .-.. .-.. ---"

input = ".... . .-.. .-.. ---"

output = "Hello"

input - A string that may be either morse code or plain English.

returns - The input converted into the opposite language of its initial format.

String morseTranslator(String text)

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme