The How-To Geek Forums Have Migrated to Discourse

How-To Geek Forums / Geek Stuff

Can anyone help me with Java Coding?

(10 posts)
  • Started 8 years ago by lilsting10
  • Latest reply from raphoenix
  • Topic Viewed 2323 times

Posts: 154

Note: Am going to post this in Geek Stuff and Off Topic to try to get help from more members.

I am currently studying for a dregree in computing, one of my modules being 'Object Orientated Programming' (which as far as I can tell is basically meaning 'java programming'). It's a module that I cannot do, and is the reason I failed last year and am having to repeat it this year. Today I have to do an exam in this module (it's about 2am now, I have to hand it back to administration at 3pm). This exam is a resit from when I did it back in the beginning of May, when I got 9% as my result. This meant I got 9 correct marks out of a possible 100, as I counted the amount of marks each question carried - which goes some way towards explaining how piss-poor I am at this. This is why I never plan to use java coding or object orientated programming again after the exam today, but it is an exam I need to pass.

Most other areas of the overall course I am great at (passed web design, hypermedia systems, usability, computer systems architecture, networks and communications.... etc.), so I don't want this one module to be the downfall of my university degree. The university have said that since this is my repeat year, if I don't pass I'm out, no questions asked. I find that rather unfair, but apparently I have to pass every module in order to pass the year. I've been straight up honest, I just hope that my obviously unfair situation over-rides the 'normal' moral judgement that 'cheating on an exam' is wrong. I get the exam paper to take away for 24 hours because I'm disabled, so I've have the questions since 3pm today, and I'm just hitting a brick wall as far as answering anything, because I just don't grasp java coding properly. Is there anyone on here that can help me by giving me the correct answers to these exam questions? My university career and I would be eternally greatful to anyone that is able to help.


1. What makes Object Orientated Programming different from non-Object Orientated Programming?
* List advantages/main concepts of Object Orientated approach [6 marks]
* Discuss each concept/advantage you have listed above with some examples [24 marks]

2. There are more than 15000 students at Edge Hill which undertaker different courses full or part-time. There are students registered on FD, undergraduate, postgraduate, and PhD programs.

What type of relationship would Student, FDStudent, UndergraduateStudent, PostgraduateStudent and PhDStudent objects form? [20 marks]
* Sketch a UML diagram to showclasses and their relationships.
* List at least two attributes and one method for each object

3. Consider the following UML class diagram: [30 marks]

| Circle |
|-radias : double - 0.0 |
|+Area() : double |
|+Circumference : double|

* Write a Java version of class Circle, using right structure and syntax for a java class. Assume it has constructor public Circle(double rad), and when it is run the area and perimeter of the rectangle are printed out.

i. Area = radias(squared) * pi
ii. Circumference = 2radias * pi

SECTION B to follow once I've typed out all the multiple choice questions.

Posted 8 years ago
Posts: 14920


Posted 8 years ago
Posts: 154

Whilst I appreciate what you're saying, raphoenix, most students aren't disabled and can better keep up with the pace of the lecturer and earn a good understanding of the module on a week-to-week basis. Due to my disabilities (eyes and ears), I have to have a note taker in lectures with me to make notes for me, on what the lecturer is talking about/what's on the lecture slides etc. Because my university switched their in-house support staff over to agencies (which the students had to arrange by themselves no less), I didn't have a support worker in place for much of the early sessions of the module, and when I did, the tutor got ill and a sub finished off the last few lessons, but they didn't have an intimate knowledge of the subject, and couldn't help me much. Looking at the link you posted is much the same as looking at the exam questions I have to find answers for, I see the words, but don't understand what they are talking about. This is, fortunately the only module I've struggled with, because the others I managed to hold my head above water before the support worker signed on, and obviously afterwards. With these special circumstances, could you or anyone else please help me?

SECTION B [20 Marks]

1. Which TWO of the following statements are usually claimed to be advantage of developing Object Orientated Programs?
a. Having a variable avaliable globally makes it easier to use them across a system.
b. There is increased code reuse.
c. The programs run more slowly but they are of better quality.
d. Simplifying dealing with complex data.

2. Which TWO of the following are not usually claimed to be an advantage of developing Object Orientated programs?
a. It helps provide controlled access to data.
b. The programes take much longer to write but they do not need much testing.
c. Object Orientated programs are difficult to maintain.
d. It provides a component based view of the system being developed.

3. Which TWO of the statements about objects ARE correct?
a. Each object contains its own state
b. A java class definitiion must include a method for the disposal of objects
c. An object can not make use of many other objects within the artifact
d. The java keyword new creates a new instance of an object

4. Which TWO of the following statements about how to identify and design an object from an application specification ARE NOT correct?
a. Verb phrases in the specification will suggest the classes and instances required
b. Verb phrases in the specification will suggest the methods required
c. The best class design is one which is based upon the real-world understanding of teh object and so is more likely to be used in future projects.
d. The best design would require a high number of classes, each with a high number of data attributes.

5. Which TWO of teh following statements about classes and objects are TRUE?
a. A class can be thought of as a blueprint, or a template, for objects of that type.
b. Only one object can be created from one class.
c. Classes are used to specify what objects will be able to do (methods) and what information they will hold (attributes)
d. If fred is a person, then we could say that fred is a class and person is an object

6. Book objects are to be modelled as part of a library system. Which TWO of the following are TRUE?
a. We need to store the ISBN of a book and so would need an ATTRIBUTE within the book class to hold this information.
b. We would expect to be able to lend a book, and so would expect to use and ATTRIBUTE to do this.
c. Many different book objects can be created from teh same book class.
d. There can only be ONE copy of any book object created from a Book class.

7. Which TWO of the following statements describes concurrent programming?
a. There is always more than one thread executing at any point in time.
b. Each process is completed before the next one starts.
c. When executing on a multi-processor computer, only one of the processors is used.
d. When executing on a single processor computre, the processor switches between threads to make it appear that they are all executing at teh same time.

8. From the following Java code extract:

Flat aFlat = new Flat(23, "Victoria Lodge");

Which statement is INCORRECT?
a. aFlat is a class
b. rentTo(aPerson) is an example of a method
c. aFlat is an object
d. aPerson is a parameter

9. Where is the mistake in the following program?
1: // Program written by abc
2: /* November 2002 */
4: /** Example class HelloWorld */
5: public class HelloWorld {
6: public static void main(String argv[]s) {
7: system.out.printIn("Hello world!";
8: }
9: }

a. Line 2 is not a comment and will not compile.
b. Line 7 does not use a correct printing statement because double quotes must be replaced with single quotes
c. Line 7 print out statement is not written right and will not compile
d. Line 9 contains an extra closing bracket

10. Which command would you use in order to run a class called Car?
a. javac Car
b. java
c. javac Car.class
d. java Car

11. What will be printed to the screen when the following code fragment executes?

double a = 2.0;
double b = 2.0;
boolean z = (a+b);
System.out.printIn("The value of z is " + z);

a. The value of z is false
b. The value of z is true
c. The value of z is 4.0
d. The value of z is 4

12. Consider the following code fragment:
int i, n;
n = 10;
for (i = 5; i<= 1; i--)
n = n -i;
System,out,printIn ("n = " + n);

Which of the following is TRUE?
a. the code will run and the output will be n = 10
b. the code will run and the output will be n = 7
c. the code has at least one syntax error
d. none of these is true

13. -

14. Consider the method declaration below:
void process( char input1, int input2 ){

Which of teh following is a correct call to teh method process?
a. process("Hello",42);
b. process(42,'A');
c. process('A',24.6);
d. process('A',42);

Posted 8 years ago
Posts: 14920

I understand your challenges and fully respect your efforts for I am disabled also and my time grows Nye.

I feel sure the Moderator of HTG will allow your post to stand.

My reply will move your post to the top of the list once again.

If you reply Off Topic also, I shall try to keep that post at the top of list.

Kindest Regards,
Rick P. ♣

Posted 8 years ago
Posts: 2815

i'm not exactly sure what you want help with? and i'm not really one to give out answers. i'm no java expert but i do know a bit of c++ and they look very similar because the questions that you posted i know how to figure most of them out. but if you could possible be a bit more specific on what you need help with i will try to do my best. :)

Posted 8 years ago
Posts: 5618

Jack, I believe all the OP needs are the answers.

Posted 8 years ago
Posts: 2815

o well that is kinda against my morals

Posted 8 years ago
Posts: 2818

Rick, i'm not fully there - are you not sure about helping because it is cheating?

Posted 8 years ago
Posts: 165

logon to you would find a specicfic forum for Java over there. And could you also mail your question paper to me too?

Posted 8 years ago
Posts: 14920


I did not give answers to the exam but at the end of the evening, my time zone, merely moved the post up in the list for those in different time zones to be able to review and comment upon. Please also note, I deleted my interim reply as to the appropriateness of the post. That is better left up to the Site Moderator and Each Member's Individual Judgment.

Kindest Regards,
Rick P. ♣

Posted 8 years ago

Topic Closed

This topic has been closed to new replies.