TASK: Create a class called Cha TASK: Create a class called Cha It should have one privat it should have oparivas achas InunBonsliniec - should have a publice which should set the goi It should override the toss EXAMPLE: If I run the following EXAMPLE: If I run the following CAFOR18650 RON String myString myürida Then myString would be the f Then myString would be the fi Sample Input: Sample Input: Sample Output: Sample Output

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

 

TASK: Create a class called CharGrid that has the following properties.
TASK: Create a class called CharGrid that has the following properties:
It should have one private instance variable of type char[][] called grid
: it should have gru erivate instanse marimble of dypechendstand numCols, which should set the grid instance variable to
should have his corpuster that hastawa parameters numRows and numCols, which should set the grid instance variable to
a chas InunRows]inuscolel filled with astetakseptemeters numRows and numCols followed by one char parameter symbol.
should have a publieenstructer thalassociat pacotes parowspd nuncal a falbsored by one char parameter symbol.
which should set the art instance variable to sherkoumRows Hnuscelsh&led with symbok in each row on its own line
• It should override the toString method such that it returns a multi-line String with the symbols in each row on its own line
EXAMPLE: If I run the following lines of code:
EXAMPLE: If I run the following lines of code:
CharGrid myGrid = new CharGrid(3,10);
6557081818 Rekreatoria(spid);
String myString myGrid.toString():
Then myString would be the following String:
Then myString would be the following String:
Sample Input:
Sample Input:
3.10
Sample Output:
Sample Output:
**
Write a program, test using stdin-stdout
Write a program, test using stdin-stdout
Wrong Let's try again.
Wrong Lets iry aga
Compilation error
: error: incompatible types: Char(11) cannot be converted to chart
Complistinterrer-String.copyyplueof(grid);
java:10:
10: error: incompatible types: char[][] cannot be converted to char[]
String striegrerString:ropyelonarceradio class Charorid cannot be applied to given types:
grid = new CharGrid(numRow, numCola);
Main.java:39! errors constructor Charorid in class CharGrid cannot be applied to given types:
required: gradintpen PharGrid(numRows, nusCols);
Transcribed Image Text:TASK: Create a class called CharGrid that has the following properties. TASK: Create a class called CharGrid that has the following properties: It should have one private instance variable of type char[][] called grid : it should have gru erivate instanse marimble of dypechendstand numCols, which should set the grid instance variable to should have his corpuster that hastawa parameters numRows and numCols, which should set the grid instance variable to a chas InunRows]inuscolel filled with astetakseptemeters numRows and numCols followed by one char parameter symbol. should have a publieenstructer thalassociat pacotes parowspd nuncal a falbsored by one char parameter symbol. which should set the art instance variable to sherkoumRows Hnuscelsh&led with symbok in each row on its own line • It should override the toString method such that it returns a multi-line String with the symbols in each row on its own line EXAMPLE: If I run the following lines of code: EXAMPLE: If I run the following lines of code: CharGrid myGrid = new CharGrid(3,10); 6557081818 Rekreatoria(spid); String myString myGrid.toString(): Then myString would be the following String: Then myString would be the following String: Sample Input: Sample Input: 3.10 Sample Output: Sample Output: ** Write a program, test using stdin-stdout Write a program, test using stdin-stdout Wrong Let's try again. Wrong Lets iry aga Compilation error : error: incompatible types: Char(11) cannot be converted to chart Complistinterrer-String.copyyplueof(grid); java:10: 10: error: incompatible types: char[][] cannot be converted to char[] String striegrerString:ropyelonarceradio class Charorid cannot be applied to given types: grid = new CharGrid(numRow, numCola); Main.java:39! errors constructor Charorid in class CharGrid cannot be applied to given types: required: gradintpen PharGrid(numRows, nusCols);
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY