Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Lab 8 (10 points)
1. Write a program that uses an array to count and report the frequency of occurrence of the letters in the text 
document provided with this lab (you can code this into your program as a String). The text was originally 
written in English; spaces and punctuation have been removed, and the text was then encrypted with a simple 
substitution cipher. 
Part 1: _________________________________
Extra credit options: 5 points: Decrypt the text _______________________________________
2. The flags of many of the world’s nations consist of 3 colored bars displayed either vertically or horizontally; two 
examples are shown below:
Flag of France Flag of Hungary
Choose a style (either the French or the Hungarian) and write a Java program that can draw the flags of three 
nations that use that (vertical or horizontal) three-color style in a window when the user clicks a button with the 
country’s name; the window illustrated below (with fake country names, other than France) is an example of 
what you are trying to create:
Your flag should change size with the window – in other words, don’t just use g.fillRect() calls – instead, set up 
JPanels and set their background colors.
Part 2: ____________________________________
Extra credit option (5 points): increase the total number of buttons to 6, and create flag pictures using both 
styles. Hint: use a 3x3 GridLayout for the display portion of the window.
__________________________________________
Additional Extra Credit Options:
• Problets tutor on Arrays: 5 points (turn in a screen shot of your completion screen, as usual)
• CodingBat exercises in sections Array1 and Array2:
• 1 point for completion of any 2 exercises (there are more than 60 in these two sections, so there are 
upwards of 30 extra credit points available)
• Be sure you log in to CodingBat before completing the exercise(s)! You won't get credit unless your work 
is recorded. Also, be sure you actually do the problem and don't just copy/paste a solution: NO CREDIT 
will be given for this approach.