首页 > > 详细

辅导Java设计、Piazza讲解、辅导Java编程、Canvas编程解析

There is no Stepik submission for this assignment. You must submit only your Java source
code files encapsulated in a zip file on Canvas. Source code files have an extension of .java
and you must name them the same as what specified in each question. Do not submit .class
files. The zip file must contain all of the source code files required to compile and execute the
program. None of the files may include a package declaration.
If you are not sure what to submit and how to submit, please ask us in the labs, office hours,
and lecture as well as on Piazza.
Calculator.java (50 points)
Write a program that simulates a very simple, but unconventional, calculator.   The
application’s GUI should  include two text fields F1 and F2 for numerical input and a label
for output. So, to compute  23 + 56, a user enters 23 into F1 and 56 into F2. There should be
four buttons labeled +, −, * , and /. When button B is pressed, the operation (F1) B (F2) is
computed and the result displayed on the label. If a button is pressed and a field F1 or F2 is
empty then the program should display an error message.  
Include a button that copies the result of the computation to F1 and another that copies the
result to F2. These buttons facilitate subsequent computation using the result of the previous
computation.  
A Quit button ends the program.
Listener.java (50 points)
Write an application with a GUI that displays a button labeled   reverse   and two text
fields. The first text field accepts a string, and the second displays the string in reverse. The
reverse string should be displayed either when the cursor is in the first text field and
the Enter key is pressed, or when the reverse button is clicked. That is, your listener must
handle events generated by either the text field or the button.
Bonus (5 points)
We will give extra 5% to exceptionally well-designed UIs.
CMPS11 - ASSIGNMENT 5 1

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!