«Home

Programming - What About Newbies Like Me?

.

Avatar
Newbie
56 answers

Hay gbanga wat school are you? Bigups to all happy new year.

0
Avatar
Newbie

Happy new year everyone. I hope you all had a nice christms. I had to rush through my course work that was meant to be sumited before christmas, but i ended up submiting on the 30th. All in all, i scored 60% which i consider too bad. but at least i am better than 3 months ago.

Will post the course work questions and my answers on here soon to let you guys know what i have been up to and my level of learning.

SO how far with the Software analysis?,

Guys i have missed chatting about java ooooo

0
Avatar
Newbie

@Ade2Kay

You are a bit competent with programming and a Computer graduate for that matter. I would not recommend you a book as you are already familiar with programming. It is waste of resource if you ask me. Since you have access to internet do google search for free tutorials on the web.

Books are for professional or nearly not a beginners in programming to try out some logic and probably case study. I did not learn programming with any book just materials from schools and my natural inquisitive to things.

When you do buy books buy the ones with lots of case study. I used to use Wrox There are many series of Java book starting from beginning to professional.

Another good book is the O'Reilly. They have lots of case studies on their books. These two books are university recommended reading text in the UK.

Finally, and people that I have not tried their books is the Digitalguru. Basically all you need to do is learn at least 20 Java API's and how to use them, even when you are sleeping. The basic milestone to learning Java is learning some of the API. Like any other language if you don't know there API (Libraries) it would be difficult to say someone to teach you.

Teach yourself first and someone can be happy to point you to the right direction.

0
Avatar
Newbie

Its ok SBU, i do understand, infact i appreciate your time and patience. Take your time, there is still a lot am learning till u sort it out anyway.

0
Avatar
Newbie

hi Sbucareer, you are a big help here.

Thanx so much for the good work

i'm a comp. science graduate.

i've written some VB, c++

but i've been in and out of java.

pls recommend a good book to me to learn java

0
Avatar
Newbie

See this

Controlling Access Members of a class

Gbenga, I am still coming with your Use Case, just busy with the New year and family things.

0
Avatar
Newbie

Not quite, Protected can only be access within it folder. Any other folders including subfolder and other folders cannot see a protected class. Look at it this way it is only protected for its family, which are in the same folder. Outside its family folder cannot bee seen

0
Avatar
Newbie

Try this

create two directories on window OS called

1. testing

2. coding

Create two classes i.e.

package testing;

public class Test1{

private int age =1;

protected int getAge(){

return age;

}

}

Second class

package coding;

public class Coding1{

private String address ="Unknown";

protected String getAddress(){

return address;

}

}

Now come out of the directoy where testing and coding is i.e. , \coding and , \testing

practice\coding and practice\testing Come under practice directory and create this class

package practice;

import coding.*;

import testing.*;

public class Demo{

private Coding1 code;

private Testi1 testing;

public static void main (String args[]){

coding = new Coding1();

testing = new Test1();

//Now do

System.out.println(coding.getAddress());

System.out.println(testing.getAge());

}

}

Try and correct the error and tell us if you now understand what is meant by protecting a class for only it class members

0
Avatar
Newbie

Mmmm, so which means that Private are methods only accessible by the original class that its implemented, protected can be called from within the original class, and any subclass, while the public method can be called by any class.

I do understand that i am a bit slow at learning, but i have decided to push myself to extreme limits in learning programming, so please be patient with my naivety and slow grasping. At least i know myself that i am better off now than months ago, when i started that java programming thread.

0
Avatar
Newbie

thanx, i'll wait till 2morow. If you come on messenger anyway, i don't mind chatting with you sometime if you don't mind. We go rock this place with java, lol

0
Avatar
Newbie

@Gbenga I will attend to this topic later tomorrow. By then I will have come up with a use case. We will tackle this as a software development, ok.

Do you understand package in java? It is like directory structure. i.e say lets take your case study for example.

I will a package (directory) called

1. admin

2. classes

3. lib

4. images

All these directories would hold different java classes. Now all java classes say in lib that has a protected keyword in them will see all classes in lib but not admin, classes and images. But the public keywords are seen by all package (directory) Private are not even seen by the same classes in the same package let alone other packages

0
Avatar
Newbie

@SBU, thanx so much, i actually got a near answer to yours. I am only suppose to explain where methods need to be private. However, i still need you to explain why you've protected the acquire and deliver methods please,

I'd appreciate it

0
Avatar
Newbie

it aint a course work, but rather a programming excersie that comes with my correspondence materials. I have posted the question, together with my own answers to give you guys an insight into what i know and to see ways in which i can develop my logical abilities.

0
Avatar
Newbie

Are we doing coursework or are we helping you to develop this case study above? Either case you better make up your mind. Believe me Gbenga, if we do your coursework for you, you have failed the process of inspiring your brain to think as a software developer.

You see the question you asked above, there is no right and wrong answer. I cannot say the answer you've given above is wrong or even right. If I was your teacher I will use the exercise to measure the way pupils think in relation to logic and programming.

Look at my own solution for data hiding and maintenance and accessibility. This is by no means right or wrong just the way I think about it for now. I don't want to go into more complex data encapsulation

public class Product {

private int stockLevel;

private String description;

public Product(){

super();

this.stockLevel = 0;

this.description = "unknown";

}

protected void deliver(int anAmount){

this.stockLevel -= anAmount;

}

protected void acquire(int anAmount) {

this.stockLevel += anAmount;

}

public String productDetails() {

return "Product " + this.description + ": "

+ this.stockLevel + " in stock."

}

public String getDescription(){

return description;

}

public int getStockLevel(){

return stockLevel;

}

public void setStockLevel(int stockLevel){

this.stokLevel = stockLevel;

}

public void setDescription(Strng description){

this.description = description;

}

}

I do not need to explain what I did above at your level now you know that I have hidden the data and made it maintenance easy (Not the best, there are other ways like interface) and accessing the hidden data.

I used protected keyword to allow class members to access it functions. If you hide data too much the software becomes unaccessible and does not make sense. It will force you to use coupling which is very bad practice. Cohesive programming is the best by hiding data to outside classes and provide interface to access other class components. You should know this since you said you now understand encapsulation

0
Avatar
Newbie

while that poductivity software analysis goes on, here is a little code that needs attention.

Here is a partial implementation of a simple class called Product some instance methods and

variables that are not relevant to the question have been omitted.

/**

* An instance of Product is a simple model of a product stocked in

* a warehouse. Each product has a description and a stock level.

*

* @author The course team

* @version 1.0

*/

public class Product

{

public int stockLevel;

// The number of items of this product in stock which is updated

// by the deliver() and acquire() methods.

public String description;

// The name of the product which will be set to a meaningful value

// by an object of some other class.

/*

*

* Constructor for objects of class Product

*

/

public Product(

)

{

super()

;

this.stockLevel = 0;

this.description = "unknown"

;

}

/**

* Reduce the stock level by the value of the argument

*

/

public void deliver(int anAmount)

{

this.stockLevel = this.stockLevel - anAmount;

}

/**

* Increase the stock level by the value of the argument

*/

public void acquire(int anAmount)

{

this.stockLevel = this.stockLevel + anAmount;

}

/**

* Returns a string giving details of the product

*/

public String productDetails()

{

return "Product " + this.description + ": "

+ this.stockLevel + " in stock."

}

}

I am trying to understand when i have to ensure data hiding and stuffs,

the question goes thus:

Describe and explain the changes you would make to the code for the Product class given

above in order to improve its data hiding and/or to facilitate its maintainability, while at the

same time allowing, where necessary, objects of other classes appropriate access to a

Product object's instance variables. When describing the changes you would make you

should detail whether the change is to improve data hiding, maintainability, or both.

If you decide to change any existing methods, you should include the code for those

methods in your answer.

If you decide to introduce any new methods you do not need to include the code for those

methods in your answer, a simple description will suffice.

Note that we do not want you to give the class any additional functionality.

the answer i gave is below, however, i know i am still missing something as i am still yet clear totally on it all, can you please hep me out with understand the solution:

my own answers:

To enhance both data hiding and maintainabiity, the main public class product which calls other classes needs to remain public, but its instance vaiables i.e public int stockLevel; and public String description needs to be declared private as they are not part of the public behaviour and also since its he objects main mehod that is allowed to access the value of its instance variables, but it exist to enhance the public visible methods. After the constructor for the object of class product is initialised,and the methods are publicly initialised, for the purpose of data hiding, the variable (int anAmount) and public String productDetails needs to be declared private as detailed below:

private void acquire (int anAmount)

private String productDetails()

it is declared private since we do not want any of its attribute to be seen by other instance object.

0
Avatar
Newbie

i have learnt classes and methods. The only thing is that i havent done any coding at all. we are only been taught the concepts as well as modify some codes,

I dont mind getting my hands wet. If i dont understand something, then i'll go and research on it and come back. I just want to be 1 step ahead of my mates.

0
Avatar
Newbie

May i still state that i am still a newbie ooo. We are only just doing introduction. We are learning types of variables at the moment, and i know the meaning of encapsulation and a bit abt declaring methods, although i dont know when and where. I just want a step by step way of doing it, so that i can learn, so please try as much as possible to simplify things. I know its a bit hard, but it will gladen my heart.

0
Avatar
Newbie

Whaoooo, thanks SBU and my2cent. I do appreciate it ooo.

Ok answers to your questions:

* I prefer it to be a standalone application. ( at least thats what i plan on using java for for now)

*It should run on a Windows platform , with hardware to be a basic computer running at least windows 2000,128MB ram, 10GB hard drive.lol,

Ok, concerning the state, let me explain what we do. We book in candidates for Health and safety tests, Cisco test, Microsoft test and other certifcations. They make use of different methods of payment, some uses Vouchers( that is where voucher regs comes in), some uses credit card(that is where booking reg comes in) and others just call in to request for information( that is where general corre comes in).

For some stuffs that we do off calls( when we dont take calls) like VAN( we are expected to spend 6 minutes on each van bookings), 10 minutes on each voucher request, 15 minutes on each general corre, 2 minutes on each registration, 2 minutes on prime, and ten minutes on voucher request.

so basically, lets say i did 10 voucher request, each time i enter 10 into the space that says "voucher request", it automatically computes 10*10 = 100minutes, spent. So for each day that i was meant to be in the office for 9 hours, i have spent 100 minutes of it to do voucher request. it then automatically compute the percentage of 100 to 9 hours and tell me my percentage productivity.

i hope i explain clearly.

Admin time available is the total numbers of minutes you are allowed to work in a particular day. it varies from 6-9 hours, break time is the is the amount of minutes you are on break( like i said, our turret dictates this as it automatically logs you out when its time for break), productiovity is the percentage of minutes you worked against your staff time. training time is the amount of minutes you spend in training, meeting time is the amount of minutes you spend in meeting, HT time is the amount of time you spend making fone calls.

Basically like i said earlier on, all details like how many vans you book, how many voucher request, you didi, will be entered intot the system manually by the employee, the Hours work, staff time, break time, training time, meeting time, and ht time, will be entered manually as well, only that our turret that calculates the time used for each of this states, will print out a copy of it and we then enter it manually into the system.

If i am not clear enough, please put more questions or should i say caution me.

0
Avatar
Newbie

Gbenga, as you want to use this as a case study to your learning programming I'd ask if the application in question would be considered a distributed app (Web) or stand alone app (GUI).

Write a requirement specification or case study I/we will deduce a good software specification for you including UML consisting of Use case, Class diagram and Object diagram.

It would also contain deployment specification or platform recommendations and hardware. From your post above I have a vague idea but the case study is still very ambiguous. Tell us in details what each state does ie.

Voucher Registration

Booking Registration

General Corre

Voucher Request

You need to explain these functions in more detail to us. That is why I said the requirement is vague. When you say compute, what are we talking about? Percentage, Derivatives, means, mode, median? What exert do you mean by compute

What is Admin Time Available, Productivity, staffed Time, break Time, Training Time, Meeting Time, HT Time, Admin Time Available?

0
Avatar
Newbie

@my2cent, i am already starting with java, since its the language i av to learn for my B.sc COmputing. I am in my early stage anyway.

Now, i am thinking of starting a small project to help me learn more. Where i work, we make use of something called productivity sheet. IT is a small program desinged using Microsoft Excel. It computes how many hours you work Monday to friday ( varies) and what you do for each hour of the day. Lets say for example, I do some telephone callings, faxing, typing, Test bookings, other administration  task e.t.c as a day to day activity.  The aim of te spreadsheet productivity is to check the percentage of my productivity.

I seem not to really like the excel sheet method of productiviy, that i want to desinging a productivity software( dont tell me to buy one since i want to use it to learn) that wil enable such capabilities, and also that will be able to track what each employee does as well as the percentage of work they have done. The name of the software that i want to desing will be Produsoft.

I need the help of SBUcareer, mimoh_mi, my2cent and others who are into java programming to help me with class diagram, guides to coding and other necessary steps please.

I have dedicated year 2007 to becoming proficient with java and not learning anyother language or easily influence to put too much in my head.

I have attached a copy of the interface of d one we use at the moment so as to enable clarity and to let u get a grasp of what i mean with relevant sensitive information erased to avoid been sacked, lol.

Please ask questions and i will post answers back here

0
Avatar
Newbie

@Seun

Good day, pls I just want to let you know that, we are all here to learn and NOBODY know's it all, and nobody ever will. So as much as you have done a beautiful thing hosting this site (Forum) , remember that, thats just half of the issue one man can't run a forum all by himself, so we have actually done a good thing by bringing the other half. So u see that take two. So please start employing the spirit of 2gedaness. remember WE is far more stronger than I. I am sorry if this hurts but the truth is the the best gift I can offer you. I had notice u handle a similar issue, irrationally. I kept quite but this time I think I have to voice out. So all the best.

0
Avatar
Newbie

I see alot of people are giving you their recommendations which is good. My advice to you is this: Learn to solve problems, your math skills should be good, your ability to reason intelligently will help you alot; when you have these prerequisites, then use computer programming languages to solve computing problems. My mum used to say that there are several ways to cook yam, 1. You can boil it 2. You can fry it 3. You can roast it 4. You can soak it in water and eat it with coconut. You can use about 4 ways to prepare yam.

The samething applies to computer programming. You can use different languages to solve different problems be it Java, C, C++, C Sharp, ASP.NET LISP, Perl, PHP, Python etc. The most important thing to consider is "Which language can solve my problems by meeting all the requirements". Remember, if you have good problem solving skills, you can use any langauge to solve problems.

To answer your question, I will advice you start with something from Adams i.e C. After that move up to Java, Python.

0
Avatar
Newbie

If someone say that, you should enlighten him/her then tell him to go f**k himself.

0
Avatar
Newbie

Okay, so my knowledge of python came from the wrong sources (thanks to bad teachers and reading-without-practice), i am a little more - er - enlightened now. but i still think u shdnt have directed that guy to python. at least not YET.

0
Avatar
Newbie

Ok, calm down. I have not banned anybody. Calm down and sorry.

0
Avatar
Newbie

No, they get banned for trolling. Imagine someone bursts in here arguing that a black man can never be as intelligent as a white man just to get a rise out of us. I felt he was just trolling because what he was saying was very ridiculous and I can't believe he actually believes that python and C++ are similar. Wtf?

0
Avatar
Newbie

So people just get banned because they argue with you? I shoulda seen this coming!!!

0
Avatar
Newbie

that's only a bit of python. file/directory manipulation, naming conventions, case sensitivity etc are the same.

python just happens to be an i[b]nterpreted[/b] language, so that as soon as you type code, you can do break-and-continue. python interpreter is python interpreter, but c++ needs header files cos its extensible, and has to be compiled, cos the target machine may not be the one on which code was written. havent you noticed that interpreted languages dont need header files? (think VB), Even java has to say "import xyz!"

0
Avatar
Newbie

Hello world in C++:

Hello world in python:

You tell me, are they at all similar?

0
Avatar
Newbie

Seun, u are really funny. u make faces at C++, and now u mention python? hah! Python look like c++, too: it was made for ppl who have a background in c/c++.

@gbenjaijot: Look for a C++ IDE called DevC++, by Bloodshed software. It has all the headers, an online community for support, and is based on GNU MinGW - its free. It also has extensions by members of the community. Also, to speed up your GUI development, theres a free class library by the name of wxWidgets (an analogue to Microsoft MFC): this combination rocks!

0
Avatar
Newbie

Consider python. It's really sweet. I heard that Ruby is similar to python but has some advantages.

0
Avatar
Newbie

da808cutie, Bluej is a very simple IDE. Getting used to it shouldn't be diffcult, in fact

that's what i use on my linux box. It has tutorial to get you started fast. Can you

just post what exactly is the problem you are having with it. I am watching

Have a lovely and error free weekend.

0
Avatar
Newbie

da808cutie, BlueJ is straight forward if you understand UML particularly Class Diagram.   

Quick Note

=============

1. ----------------> Association to object causing dependency

2. <------------------> bidirectional association

3. ------------------- Association

4. ---------------<> Aggregation

5. ---------------<@> Composition (@ = Black diamond)

6. ----------------|> Inheritance - Generalization

7. <|--------------  Inheritance - Specialization

8. -----------------O Interface

0
Avatar
Newbie

BlueJ is an integrated development environment (IDE) for java you can learn about, and download it at http://www.bluej.org.

0
Avatar
Newbie

does anyone know how to program using BlueJ? or any other OOP?

HELP NEEDED FAST

THANX IN ADVANCE.

0
Avatar
Newbie

See also: http://members.aol.com/aprilnotafool/ebooks/

0
Avatar
Newbie

Guys,

I don't usually recommend C/C++ as a programming language of choice to newbies. In fact, I know of 2 people who back-pedalled to learning VB.

C++ is a strongly type language. It's a language that assumes a solid background in maths and logic.

I have written many activex and COM servers for some of my VB developers.

Ask VB developers, they will tell you how they hate interacting with Windows APIs.

If VB was written in C++ and Java tends to be like C/C++, then I would agree to the fact that C/C++ is the mother of them all.

Like I said earlier, if you want speed,power and control over hardware and/or peripherals, if you want to know when to RTS to a device attached to RS-232 port without activex and the likes, then go 4 C/C++.

Regards,

Emmanuel.

0
Avatar
Newbie

java can never compete with C++ in terms of speed. nobody develops full time desktop apps with java without putting in some C/C++ or any other language. why? because java is slow.

Well, gbengaijot. C++ is a good choice but if you're going to want to make a living as a coder in Nigeria, it'll be best to learn C-sharp or Java later. as per resources, there are plenty on the web. if you don't have Microsoft's Visual Studio, you can download free compilers from the net. just go to any C++ site and you'll find plenty resources, tutorials and links to help get you started. elbaron has also got some tutorials here on Nairaland.   I'm sure he'll put up some links.

ps: you can download ms Visual C++ compiler from microsoft.com but you don't get the IDE.

0
Avatar
Newbie

yeah thats right. learning VB means you're tied to M$. that means you can't program on linux, symbian or any other exotic platform. you'll belong to Mr. Gates who is even concentrating more on his C-sharp. so VB IMO isn't a good choice.

Real programmers program in C/C++

0
Avatar
Newbie

I would suggest you start with C and graduate to C++. Delphi is also not a bad a language to learn for web development. For those recomending .Net and visual basic. You must understand that those languages are used sorely for the purpose of developing windows applications. C++ is it for a programmer who is worth his onion. Not only does it give you versatility, it is also the mother of all languages. Think about it.

0
Avatar
Newbie

Depends on what you're doing with visual basic, though I do agree with what you're saying about visual basic. Alot of people that are no good at programming think that they're the next bill gates because they can do a counting program.

Though there are some people that are very good at visual basic and can do just the same amount of stuff in visual basic as you can in C++.

0
Avatar
Newbie

yeah, you're right. but that's just because java is ready-made with all kinds of classes and libraries. on the other hand u can't do much with ANSI C/C++. but if you've got the right libraries, you can.

as per visual basic, i think it's a crappy language for kids. it's one language that deceives people - making them think they're good at something.

0
Avatar
Newbie

I won't agree that Java is better than C++. Before choosing to learn C++, I read in different places that Java is actually slower.

0
Avatar
Newbie

Yes but in terms of speed of writing code, it takes less time to get a java/visual basic app up and going comapred to a C++.

0
Avatar
Newbie

what the hell do u mean? anything can be coded in C/C++ in no time. unless u only program web stuff (the boring stuff). the significant apps on the planet are all coded in C/C++.

0
Avatar
Newbie

because no software dev. company (the bigger ones) in nigeria use C/C++. it's all full-blown OOP, java, C-sharp and even delphi. C++ is rarely used. C is totally out of it.

0
Avatar
Newbie

not exactly my guy. as much i as i hate to admit it, C-sharp is gaining fast ground. well it also depends on whether the guy wants to program for a living. if yes then c/c++ isn't for you as long as you dey naija.

0
Avatar
Newbie

If you want power and control, go 4 C/C++.

Regards,

Emmanuel

0
Avatar
Newbie

My recommendation, since you're primarily interested in website design and development: Learn HTML, PHP, MySQL, maybe Dreamweaver, and you'll be ready for some practical website design and development!

Some Useful Links:

- Introduction to HTML

- PHP Manual in English

- MySQL Reference Manuals

- Macromedia Dreamweaver

- Search Google for other free materials!

When I was younger, I used to pride myself in understanding C/C++/Java and one of my friends focussed on just PHP. Now he has become a guru in programming because he gets a lot of Jobs while I have had to start afresh in a different field. PHP and MySQL will make you productive, more than any other language.

0
Avatar
Newbie
Your answer
Add image

By posting your answer, you agree to the privacy policy and terms of service.