Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Help on a Java Project

dontenter

Novice
Advanced Member
Messages
36
Reaction score
0
Points
26
"Automatically grading Java programming assignments via reflection, inheritance, and regular expressions" this is the program my prof assigned me this prelim. I think medyo advance kasi regular expressions and inheritance palang topic namin. Patulong naman po sa mga bagay na dapat kung aralin or iresearch. Suggestions, advice, codes na dapat iconsider at gamitin para sa project na to :help:

Puro online softwares lang ang nakikita ko sa web eh :'(
 
Andun na yun hint sa pag aaralan mo ts, "regular expression" and "inheritance" . Sa pagkaka alala ko Object Oriented na yun inheritance pero madali lang nman yun. ^^
 
Pinag aaralan ko rin naman po sila. Pero hindi ko parin maimagine kung pano ko sisimulan at iaapply sa sobrang basic ng knowledge ko sa topics na yan. :( Baka po may idea kayo ng pwedeng steps. Yung inheritance pag extend lang ng class ang alam kong gamit and yung regular expressions pang search gamit ng keywords.

Nabasa ko pa Perl regular expressions yung ginamit. pwede ko ba imix yung gamit ang eclipse lang?
 
Patulong po sa project namin :) i
di ko po kase alam kung saan magsisimula...
ito po...

Create a Java program that performs the typical operations of an automated telling machine(ATM). Specifically, the program shall perform withdraw, check balance, and deposit. Set up an object to perform those operations and set up a constructor to initialize important values such as the owner of the account, the bank name and the initial balance. Initialize a balance of 10,000Php. After completing an operation(such as checking balance), the program should ask the user whether he or she would like to perform another operations (such as withdraw a cash or deposit a cash) or end the transaction. Thus, you will need to set up a loop, Handle the possible exceptions that may occur during the operations. Record the history of the transactions to a text file.Hence, if a user withdraws a cash, your balance after the user withdrawn the cash. For example, the program will record a transaction and date the user performed the transaction history and looks like."The user has withdrawn 5,000. The balance is 5,000". Finally record that time and date the user performed the transaction. If the user perform another transaction while the program is still running. It must also be recorded to the text file.


Yan po maraming salamat and God bless! :)
 
anong ibig sabihin ng "Automatically grading Java programming assignments"?

just use reflection, inheritance at regular expressions -- yan lng naman main requirements diba

implement the most basic uses ng bawat isa





inheritance:

sabi mo alam mo na to, just create objects na kailangan ng application mo -- extend mo ng konti (as needed) using classical inheritance






regular expression:

imbis na gumamit ka ng if else at looping constructs para mag-process/validate ng user string input -->> use REGEX instead

>>>> examples:

phone number format: 000-0000

date and time format: 30-01-2003 15:20

madami pwede ka pag-gamitan ng regex




reflection:

i don't know anything about reflection at hndi ako java programmer pero this example makes the most sense para sakin na walang alam sa java:

Isuru Jayakantha of StackOverflow said:
simple example for reflection. In a Chess Game, you do not know what will be moved by the user at run time. reflection can be used to call methods which are already implemented at run time.

http://stackoverflow.com/questions/37628/what-is-reflection-and-why-is-it-useful

Code:
public class Test {

    public void [B][COLOR="#FF0000"]firstMoveChoice()[/COLOR][/B]{
        System.out.println("First Move");
    } 
    public void [B][COLOR="#FF0000"]secondMOveChoice()[/COLOR][/B]{
        System.out.println("Second Move");
    }
    public void [COLOR="#FF0000"][B]thirdMoveChoice()[/B][/COLOR]{
        System.out.println("Third Move");
    }

    public static void main(String[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { 
        Test test = new Test();
        Method[] method = test.getClass().getMethods();
        //firstMoveChoice
        [B][COLOR="#FF0000"]method[0].invoke(test, null);[/COLOR][/B]
        //secondMoveChoice
        [B][COLOR="#FF0000"]method[1].invoke(test, null);[/COLOR][/B]
        //thirdMoveChoice
        [COLOR="#FF0000"][B]method[2].invoke(test, null);[/B][/COLOR]
    }

}

insead of calling the methods directly using their names, pretend that you don't know they exist and use reflection to invoke them instead........

(in this example) -- reflection allows you to inspect METHODS and CLASSES kahit hindi mo alam mga names nila

yan reflection an agad yan lol

again, just implement the most basic uses ng bawat isa

make it neat and presentable at ok na ok na yan




dag dag ka mga comment explaining when u used them, examples:

// this helper function processes the user input and checks if it's a valid phone number using REGEX

// this is a method call to firstMoveChoice using RELECTION

// this class INHERITS from ........ etc etc



para mas malinaw sayo at sa prof mo na ginamit mo sila
 
Last edited:
una paps gawa ka class with basic properties pati methods nadin sama mo

tapos gawa ka object that inherit the class tapos basic grade calculation lang ikaw lang bahals a formula basic math nayan depende sa gusto mo

then basic calculation basic express are already there mero kanang mga condition and user defined var and basic logic. diyan
tapos output mo agad or stored type all result into variables or output agad pagkatapos mag enter yun lang hehe :)
 
ang pagkainindi ko sa reflection is simply a way for the software to inspect itself at runtime. usually yung metadata ng running application yung pina process sa ganun. yung sa regex naman, gagamitin mo cguro yan para mag search ng patterns sa code, then dun ka makaka kuha ng hints sa structure nung assignment, and yung inheritance cguro yung pattern na i sesearch?

can you elaborate kung ano pa sinabi ng prof nyo TS, like anong requirements para masabi kung ilang points ang code ng assignment? ComSci subject ba yan, san school nyo if you dont mind?
 
Back
Top Bottom