The Artima Developer Community
Sponsored Link

Java Answers Forum
Everyone, this is the real question. Pls help.

6 replies on 1 page. Most recent reply: Aug 19, 2005 12:50 AM by Jeroen Wenting

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 6 replies on 1 page
madevil

Posts: 3
Nickname: madevil
Registered: Aug, 2005

Everyone, this is the real question. Pls help. Posted: Aug 6, 2005 2:27 AM
Reply to this message Reply
Advertisement
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:
------------------
 
public class Meth1
 
{
	public static boolean 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
	
	public static boolean 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 for this purpose.
 
Tips:
-----
 
import java.io.*;
 
public class TestMeth1
{
	public static void 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    void    import
 
   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.
   	 .
  	}
} 
 
 
public class TestTask1b
{
	public static void main
	{
	 Task1b t = new Task1b();
	 .
	 .
	 .
	}
}
 
THE END


Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: Everyone, this is the real question. Pls help. Posted: Aug 7, 2005 11:41 PM
Reply to this message Reply
Your response is in the Thread I had started.

(I don't know why I'm doing your homework).

madevil

Posts: 3
Nickname: madevil
Registered: Aug, 2005

Re: Everyone, this is the real question. Pls help. Posted: Aug 15, 2005 8:56 AM
Reply to this message Reply
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.

Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: Everyone, this is the real question. Pls help. Posted: Aug 15, 2005 11:20 PM
Reply to this message Reply
Lol!!!

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...

Good luck with the semester...

Spike

Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Everyone, this is the real question. Pls help. Posted: Aug 16, 2005 10:36 PM
Reply to this message Reply
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.

Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: Everyone, this is the real question. Pls help. Posted: Aug 16, 2005 11:41 PM
Reply to this message Reply
> 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.

Jeroen Wenting

Posts: 88
Nickname: jwenting
Registered: Mar, 2004

Re: Everyone, this is the real question. Pls help. Posted: Aug 19, 2005 12:50 AM
Reply to this message Reply
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.

Flat View: This topic has 6 replies on 1 page
Topic: Java Native Interface Previous Topic   Next Topic Topic: free java tutorial

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use