Find Jobs
Hire Freelancers

Interpreter

$25-30 USD

Đã hoàn thành
Đã đăng vào hơn 21 năm trước

$25-30 USD

Thanh toán khi bàn giao
Write Java classes to support a processing of arithmetic expressions in prefix notation called PNInterpreter.? Expressions in prefix notation contain an operator first and then the operands on which the operation is performed. For example, + 3 4 is equal to 3 + 4 in the infix notation. For this assignment your program should support integers only and the following operators: + - * / ^. ? There are a variety of ways to implement the prefix notation interpreter. One way is to use stacks.? Another would be to use a tree.? Chose either one of the two ways and implement the necessary data structures instead of using the built-in Java classes. Trees and stacks and their implementation are discussed in most data structure textbooks. Your interpreter should accept strings of operators and operands seperated by spaces (no parenthesis) and return each operation it performed and the final result or output an error if the input is invalid. ? Write a main program that calls the test on your implementation to demonstrate that it works correctly. Call the main class PNInterpreterDriver. Write a test method testInterpreter that works with an object of your implementation of PNInterpreter.? testInterpreter should be able to read from standard input a list of expressions like this: * + 2 * 4 6 + 3 5 - - / 3 4 * 5 6 2 - 3 2 + 2 quit ??quit?? (or encountering the end of stream) is the signal to stop reading from the standard input. The test method (using StreamTokenizer or similar built-in stream class) should read these commands and act appropriately. For example, with the following test file, you might see something like this as the output of the program: brillig(65)#java PNInterpreterDriver < [login to view URL] Testing string: * + 2 * 4 5 + 3 5 operation performed: 4 * 6, result 24 operation performed: 2 + 24, result 26 operation performed: 3 + 5, result 8 operation performed: 26 * 8, result 208 Final result: 208. Testing string: - - / 3 4 * 5 6 2 operation performed: 3 / 4, result 0 operation performed: 5 * 6, result 30 operation performed: 0 ??" 30, result -30 operation performed: -30 ??" 2, result -32 Final result: -32. Testing string: - 3 2 + 2 operation performed: 3 ??" 2, result 1 invalid expression, reached end of expression command: quit Testing complete. ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) The program MUST meet the specifications EXACTLY. In other words, DO NOT add any extra "features". If it doesn't ask for a GUI or extra mathematical features, don't include it! 3) Complete ownership and distribution copyrights to all work purchased. ## Platform This program is to be written in Java only so it should be platform independent. ## Deadline information This project MUST be completed by Tuesday, October 1, 2002, 8:00am EST, US. Do not bid on this project if you cannot meet the deadline.
Mã dự án: 2872429

Về dự án

19 đề xuất
Dự án từ xa
Hoạt động 22 năm trước

Bạn muốn kiếm tiền?

Lợi ích khi chào giá trên Freelancer

Thiết lập ngân sách và thời gian
Nhận thanh toán cho công việc
Phác thảo đề xuất của bạn
Miễn phí đăng ký và cháo giá cho công việc
Đã trao cho:
Avatar người dùng
See private message.
$7 USD trong 14 ngày
4,8 (13 nhận xét)
2,5
2,5
19 freelancer chào giá trung bình $17 USD cho công việc này
Avatar người dùng
See private message.
$25,50 USD trong 14 ngày
5,0 (119 nhận xét)
6,8
6,8
Avatar người dùng
See private message.
$21,25 USD trong 14 ngày
4,8 (37 nhận xét)
5,3
5,3
Avatar người dùng
See private message.
$17 USD trong 14 ngày
4,7 (41 nhận xét)
4,7
4,7
Avatar người dùng
See private message.
$25,50 USD trong 14 ngày
4,8 (60 nhận xét)
4,2
4,2
Avatar người dùng
See private message.
$17 USD trong 14 ngày
5,0 (26 nhận xét)
3,7
3,7
Avatar người dùng
See private message.
$17 USD trong 14 ngày
5,0 (53 nhận xét)
3,3
3,3
Avatar người dùng
See private message.
$25,50 USD trong 14 ngày
4,8 (9 nhận xét)
3,3
3,3
Avatar người dùng
See private message.
$23,80 USD trong 14 ngày
4,6 (11 nhận xét)
3,1
3,1
Avatar người dùng
See private message.
$6,80 USD trong 14 ngày
5,0 (5 nhận xét)
1,9
1,9
Avatar người dùng
See private message.
$12,75 USD trong 14 ngày
5,0 (3 nhận xét)
1,8
1,8
Avatar người dùng
See private message.
$16,15 USD trong 14 ngày
5,0 (2 nhận xét)
0,4
0,4
Avatar người dùng
See private message.
$12,75 USD trong 14 ngày
5,0 (3 nhận xét)
0,4
0,4
Avatar người dùng
See private message.
$17 USD trong 14 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
See private message.
$8,50 USD trong 14 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
See private message.
$12,75 USD trong 14 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
See private message.
$25,50 USD trong 14 ngày
0,0 (0 nhận xét)
1,1
1,1
Avatar người dùng
See private message.
$15,30 USD trong 14 ngày
0,0 (0 nhận xét)
0,0
0,0
Avatar người dùng
See private message.
$21,25 USD trong 14 ngày
0,0 (1 nhận xét)
0,0
0,0

Về khách hàng

Cờ của UNITED STATES
United States
4,9
8
Thành viên từ thg 9 1, 2002

Xác thực khách hàng

Cảm ơn bạn! Chúng tôi đã gửi email chứa đường link để bạn lấy tín dụng miễn phí.
Đã xảy ra lỗi trong khi gửi email của bạn. Hãy thử lại.
Người Dùng Đã Đăng Ký Tổng Số Việc Đã Đăng
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Đang tải xem trước
Đã cấp quyền truy cập vị trí.
Phiên đăng nhập của bạn đã hết hạn và bạn đã bị đăng xuất. Hãy đăng nhập lại.