Suljettu

Java Program

The goal is for the program to learn words as it reads characters.

Example input:

[url removed, login to view]: import

[url removed, login to view]: import word1 word1

Example output:

import* word1? word1@

It recognizes that import is a reserved word (it was present in [url removed, login to view]) and indicates it with the *

It recognizes that word1 is a new word so it marks it with a ? and saves it

It recognizes that is saw word1 before so it marks it with a @

-----------How to do it----------------------

You should have 3 arrays:

switch - type int - size 54 - this contains the index of the first word that starts with that character.

These two are parallel arrays:

symbol - type char - size MAX_SIZE - holds what character is consumed at this spot

next - type int - size MAX_SIZE - holds where to jump to if the character you want isn't at this spot

You also need an int to store the currently used size of the two parallel arrays - I will call it sizeUsed

You are to read the file one character at a time.

example word: aWord3

If this character is 'A'-'Z', 'a'-'z', '_' or '$', it is the beginning of a word (if it is not one of these, ignore it).

You have to take this first character and turn it into the corresponding index of the switch array.

The standard is: 'A '-> 0, 'B' -> 1, ..., 'Z' -> 25, 'a' -> 26, ... , 'y' -> 50, 'z' - > 51, '_' -> 52, '$' -> 53.

So for example if you encounter 'a' first you need to check switch[26], so on.

The value of the switch array corresponds to the index in symbol where that word is continued. If it is a set number, follow it to the next step. If the index is undefined (I indicate this with -1), you have to set it to the next free index (sizeUsed) and use that for the next part.

Now you move on to the parallel array. You check the next letter, in our case 'W', if it is what is in symbol[switch[26]]. If it is, you simply go to the right (symbol[switch[26] + 1]) and compare with the next character and so on. If symbol[x] contains a blank character (I used ' ' for this), you need to write the current character there and increase max size. If symbol[x] contains a character other than what you are consuming right now, you look at the next[x] (using the same index as what you just used with symbol), and try looking at symbol[next[x]]. If next[x] is undefined (in my case -1 again), I set it to the next free index (sizeUsed) and continue there.

Finally, once you encounter a character not 'A-Z', 'a-z', '_', '$', or '0'-'9' (a word may not start with 0-9 but it CAN have it afterwards), you expect to reach an "end of the line" character. If you are writing the word, you need to place an end of the line character. There are 2 end of the line characters: '*' which you use when inputting/reading the reserved words ([url removed, login to view]) and '@' which you use when inputting/reading the java program ([url removed, login to view]); either one indicates you successfully matched the word when reading.

Last thing is you have to make sure during this whole process the output text gets generated. So when you know you have a word you need to be storing/printing the characters, and you have to print a '?' if you had to write the word and a '@' or '*' if you read the word, depending on what it stored.

Taidot: PHP, tietojärjestelmäarkkitehtuuri

Näytä lisää: simple chat program java, processor scheduling program java simulation round robin, client server poker program java source, simple project gui program java, simple gui math program java, bidding program java randomly generated items price, page replacement program java code, election program java, tiny college program java, program java gui, simple quiz program java, gui program java, finish program java, message program java, quiz program java

About the Employer:
( 0 reviews ) United States

Projektin tunnus: #13174762

23 freelanceria on tarjonnut keskimäärin 50 $ tähän työhön

dobreiiita

Hello I am Java expert and interested in this project. I have reviewed the details and confident to handle it perfectly. I have a lot of experience in helping in students with assignments, so I will keep cod Lisää

30 $ USD 1 päivässä
(123 arvostelua)
6.4
AhmedLabib93

Hello My name is Ahmed, i'm a top rated freelancer. i worked over 250 projects and over 600 hours doing java projects. plus i passed freelancer java exam with top 15% plus i got 2 java certificate 1Z0-803 and 1Z0- Lisää

57 $ USD 0 päivässä
(170 arvostelua)
5.9
schoudhary1553

Greetings sir, i am an expert freelancer for this job and your 100% satisfaction is assured if you allow me to serve. Here is the reason. Why you should pick me? a) I am a very expert and have the same kind of ex Lisää

68 $ USD 1 päivässä
(24 arvostelua)
5.4
73 $ USD 1 päivässä
(16 arvostelua)
5.4
huypq5

As description in your requirement. I'm sure to complete this tool for you. inbox me if you have any question about my skill or this project. Thank for your attention HuyPQ.

77 $ USD 1 päivässä
(30 arvostelua)
5.1
ypsilonindore

Greetings, I believe you are doing well. I have great 7+ years of experience in web development as well as app development. I have gone through your requirements. Please open a line of chat so we can discuss further Lisää

19 $ USD 1 päivässä
(6 arvostelua)
4.6
utkarshkatiyar19

A proposal has not yet been provided

100 $ USD 1 päivässä
(20 arvostelua)
4.6
bharatchhabra13

Dear Hiring Manager, I am very interested in your respective job post.I am working as a freelancer from last 6+ years and have extended knowledge of web designing, webdevelopments, mobile apps or online and my worki Lisää

111 $ USD 1 päivässä
(10 arvostelua)
4.1
KSVWebster

SALUTATIONS How are you? I hope you are doing well and the season is going great for you and your business. I and my team have gone through your requirements for this project. And one thing I can assure you that t Lisää

50 $ USD 2 päivässä
(5 arvostelua)
2.9
Minaxi19

Hello Sir, I am interpreted in doing this work in minimum time and minimum cost for you. i have more than 6 years of expertise in java development. Eagerly awaiting to hear from you sir. Thanks, meenakshi

25 $ USD 1 päivässä
(2 arvostelua)
2.6
MuhammadRohailP

Hello I am an expert in java development and can easily carry out this task for you. I have vast experience in java and can handle the job fairly quickly for you. Regards

15 $ USD 1 päivässä
(6 arvostelua)
2.4
30 $ USD 1 päivässä
(4 arvostelua)
2.3
quickwriter24

We are highly experienced Post Graduate Engineers, Doctors, IT, ITES, Software, Infrastructure Professionals, Web Designers and IT Architects. We can redo, improve, and publish any engineering, scientific MATLAB, S Lisää

10 $ USD 1 päivässä
(3 arvostelua)
2.4
shamuztab

Hi, I am software engineering student with good command over [url removed, login to view] can rely on me for the accomplishment of the job you offer, I have done multiple projects you can rely on me for any sort of application. I am look Lisää

100 $ USD 3 päivässä
(1 arvostelu)
1.4
Steinwendner

I am open for negotiation. If you want high quality, I am your man! Message me if you need anything.

130 $ USD 2 päivässä
(1 arvostelu)
1.2
40 $ USD 1 päivässä
(0 arvostelua)
0.0
vamikaastra2

hello client i have a very good experience to create a websites and responsive designing you can hire me for this job please check my work below and you can contact me any time i will provide you a quality Lisää

45 $ USD 2 päivässä
(0 arvostelua)
0.0
MrWhiteWalker

The requirements specified are pretty straight forward and I have placed my bid at a really low price because I am new at this website.

35 $ USD 1 päivässä
(0 arvostelua)
0.0
habibzafar

Seems like an interesting problem to be solved and will get to learn more solving this problem. I understood the problem to very extent. Just need bit more information and we are all set.

45 $ USD 2 päivässä
(0 arvostelua)
0.0
akkysoft2

Hi There, We are a team of PHP experts having combined experience of more than 5 years in PHP and Web-Designing. We are 10+ employees working round the clock for our overseas clients. -An Excellent HTML and CSS skill Lisää

30 $ USD 5 päivässä
(0 arvostelua)
0.0