Project #41727 - Easy java programming

1.

 

Theme: Classes and objects

File names: Mobil.java, Person.java, Oppgave51.java

 

 

A)   Code a class ”Mobil” and give it the variables ”merke” (brand), ”eier” (owner) og ”telefonnummer” (phone number). Then make methods for saving data in the variables. Make an object of the class in another class, ”Oppgave51”, which contains the main method. Fill thge object with data

 

B)   Code a class ”Person” which contains variables for ”navn” (name), ”alder” (age) and ”bosted” (location). Also make methods for adding the information in the object.

 

C)   Make an object of the class ”Person” in the main method in the class ”Oppgave51”,  and set appropiate values for ”navn” (name), ”alder” (age) and ”bosted” (location) from the main method.

 

 

 

2.

 

Theme: Theory

File name: Teori.txt

 

Give short answers to the questions bellow:

 

A)            What is encapsulation? Why is it useful?

 

B)            What is the interface of a class? How does it seperate from implementation of a class?

 

C)            What is an instance method and how does it seperate from a static method?

 

3.

 

Theme: String, textediting.

File names: Tekster.java

 

A)            Create a program with a variable containing the text ”Agnes i senga”. Use a loop to print the text in the variable backwards.

 

B)            Create a variable containing the text ”INF1000” and a variable containing the text ”inf1000”. Make a test for whether these two are equal.

 

C)             Then make a variable containing the text "INF1100INF1000INF1010". Make The program so that only the ”INF1000” are collected/picked out and save this to a new variable which you print to the terminal.

 

D)           Make a variable containg the text “Espen Askeladd”. Read about String.toChararray here and use this method to save the content of the variables in an array of letters. The go through this array and every time you see the letter “a” you replace it with the letter “A”.

 

 

4.

 

Theme: Own assignment

File name: MinOppgave5.java and Beskrivelse.txt

 

Create your own assignment/program where you use classes and objects. Also a description of the program must be delivered.

Subject Computer
Due By (Pacific Time) 10/01/2014 03:00 am
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy