I saw few people posted this but wrongly formatted and incomplete.
This is the real thing.
Now see if anyone can pls help. Thank u.
As for the rest, finally u know what this is all about ",
Task 1
------
Class, Inheritance, String Processing, Sorting, Searching
Consider the code:
------------------
publicclass Meth1
{
publicstaticboolean words(String[]p,String[]q)
{
boolean flag=true;
for(int i=0;(i<q.length && flag);i++)
flag=(look(p,q[i]));
return flag;
}//words
publicstaticboolean look(String[]p,String w)
{
boolean flag=false;
for(int i=0;(i<p.length && !flag);i++)
if (p[i].equals(w))flag=true;
return flag;
}
}//Meth1
a) Work out and document the processes being carried out by the method "words"
in the above class. Your documentation should include any data used forthis purpose.
Tips:
-----
import java.io.*;
publicclass TestMeth1
{
publicstaticvoid main(String args[])
{
String w1[]={"cast","static","thread","make","void","import"};
String w2[]={"import","cast","static"};
Meth1 m = new Meth1();
System.out.println(m.words(w1,w2));
}//main
b) A client has an array of English words. What is required to list all those words
from the array, which come alphabetically after the word "make", and they are to
appear in alphabetical order.
For example, given an array of words as shown below:
cast static thread make voidimport
should produce an array of words:
static thread void
Use inheritance to extend the class "Meth1" to provide the necessary methods
which achieves the specified requirement.
Tips:
-----
//Do inheritance with Task 1 a)
{
void sortWords(...)
{
.
.
.
}
void displayAll(...)
{
.
.
.
}
void displayFrom(String w[], String point)
{
.//if point exist in String w[], output all words after "make"
.//else, error message.
.
}
}
publicclass TestTask1b
{
publicstaticvoid main
{
Task1b t = new Task1b();
.
.
.
}
}
THE END
Actually Im a college student. I just started doing java and this is a very short semester, only 2 months! I had to prepare for my exam and do this assignment. This is only Task 1. I have another two more Tasks (which im doing now, GUI and Vector) and have to submit by 19th August with the documentation. Im also doing another two subjects and i cant cope. In my last semester, I got a distinction and 2 credits for my papers. I did all by myself. Im not a lazy person. Im just weak in programming and im running out of time. Thanks for ur help. Really appreciate it.
Poor you... Been there... Coffee and 3 am morning always did the trick on my software engineering projects, I've done the whole summer school thing too so I see where you're coming from... I sacrificed the ridiculous Philosophy, Poli Sci. courses to understand the CS/Software Engineering stuff.
Anyways, nuff of that...
All I've been trying to say is, couldn't you find a more subtle way to ask a question and not just copy and paste your assignment on this forum. If Comp. Sci. is not your major I understand though (if there are easy ways to get 100s on stuff that is bound to bring your GPA down why not use them - I'd do the same).
I do however appreciate the fact that you do take the time to format the code in a manner that helps us assist you though...
Here's what you should do. Print out this code, take it to your professor and slam it down on the desk, saying that it is an insult to your intelligence to look at such poorly written slop. Class names like TestMeth1, method names like Meth1? It's intollerable! Demand that you get your much deserved "A" in this class without having to sully your mind on such badly written trash.
For extra credit, you could point out to the professor that you've posted the assignment to forums on the internet and no one there was interested in looking at it either (even when it was nicely formatted). That will prove your point decisively and any rational professor will concede it.
> Here's what you should do. Print out this code, take it > to your professor and slam it down on the desk, saying > that it is an insult to your intelligence to look at such > poorly written slop. Class names like TestMeth1, method > names like Meth1? It's intollerable! Demand that you > get your much deserved "A" in this class without having to > sully your mind on such badly written trash. > > For extra credit, you could point out to the professor > that you've posted the assignment to forums on the > internet and no one there was interested in looking at it > either (even when it was nicely formatted). That will > prove your point decisively and any rational professor > will concede it.
LOL!!! That was hilarious man. I laughed my ass off, probably get fired for causing racaus.
I guess academics don't really abide by good coding standards and don't really care for neat and legible (meaningful) code. I've had scenarios like that in my past courses.
Better yet: tell your professor to give you more interesting assignments that are closer to the real world so the people you ask to do them for you don't notice that it's homework.