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.

Квалификация: PHP, Архитектура ПО

Показать больше simple chat program java, processor scheduling program java simulation round robin, client server poker program java source, php, java, software architecture, 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

О работодателе:
( 0 отзыв(-а, -ов) ) United States

ID проекта: #13174762

23 фрилансеров(-а) в среднем готовы выполнить эту работу за $50


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 Больше

$30 USD за 1 день
(123 отзывов(-а))

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- Больше

$57 USD за 0 дней(-я)
(170 отзывов(-а))

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 Больше

$68 USD за 1 день
(24 отзывов(-а))
$73 USD за 1 день
(16 отзывов(-а))

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 день
(30 отзывов(-а))

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 Больше

$19 USD за 1 день
(6 отзывов(-а))

A proposal has not yet been provided

$100 USD за 1 день
(20 отзывов(-а))

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 Больше

$111 USD за 1 день
(10 отзывов(-а))

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 Больше

$50 USD за 2 дней(-я)
(5 отзывов(-а))

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 день
(2 отзывов(-а))

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 день
(6 отзывов(-а))
$30 USD за 1 день
(4 отзывов(-а))

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 Больше

$10 USD за 1 день
(3 отзывов(-а))

Hi, I am software engineering student with good command over [login to view URL] 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 Больше

$100 USD за 3 дней(-я)
(1 отзыв)

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

$130 USD за 2 дней(-я)
(1 отзыв)
$40 USD за 1 день
(0 отзывов(-а))

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 Больше

$45 USD за 2 дней(-я)
(0 отзывов(-а))

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 день
(0 отзывов(-а))

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 дней(-я)
(0 отзывов(-а))

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 Больше

$30 USD за 5 дней(-я)
(0 отзывов(-а))