Unformatted text preview:

C Sc 127A Lab 3: ObjectsHand back QuizzesReview String and BankAccount objectsIntroduce Grid ObjectsForm a team of two, login to the account of the person whose name alphabetically follows the otherHave the person owning the account write the code for a solution for 1)Test your program until the program is correctHave the person not owning the account write the code for a solution to WholesaleCostTest LetterI until the program is correctC Sc 127A Lab 3: Objects Collaboration Complete this with other person from your section during your scheduled lab. Grading For 100%, don't be late to lab and stay to end of lab –or– complete all programs.A. Recitations • Hand back Quizzes• Review String and BankAccount objects • Introduce Grid ObjectsB. Implement four main method programs with objects in a team of two, each person types two programs• Form a team of two, login to the account of the person whose name alphabetically follows the other• Click the Eclipse Icon• Create a new project that will contain both Java programs by selecting File > New > Java Project• After Project Name enter Lab3Objects• Create a class with File > New > Class • After Name: type the name of the class you want to create. For this first program, use NameConversion• Have the person owning the account write the code for a solution for 1)• Test your program until the program is correct1) NameConversion: No extra files or imports neededWrite a Java program that inputs a name in the form of the last name, a comma, a space, the first name, a space, aninitial, and a period (as shown in the input below). Display the first name, a space, the initial, a period, a space, andthe last name. Make sure the comma is after Jones on input and that the comma is not in the rearranged name. Ifyou enter Jones, Kim R. your program must generate a dialogue that looks exactly like this:Enter name as Last, First I. Jones, Kim R.'Jones, Kim R.' rearranged is: 'Kim R. Jones'2) TwoBankAccounts: You need to add BankAccount.java to your projectTo complete this, you need you need to get BankAccount.java into your projectWrite a complete Java program that will perform the following actions:1. Read the data needed to construct two different BankAccount objects2. Read a deposit amount for both, and deposit that amount to both objects 3. Read a withdrawal amount for both and withdraw that amount from both objects4. Print the IDs and balances of both objects. The balance must be shown with a $ 5. Show the combined balances of both BankAccount objects after all transactionsOne ID: DevonOne initial balance: 111.10Another ID: KimAnother balance: 222.20Amount to deposit: 10.00Amount to withdraw: 20.00One: Devon $101.1Another: Kim $212.2Combined balances: $313.3· Switch coders (typists) at the second program. Do not have one person typing in everything. · Import Grid.java· Create a class with File > New > Class · After Name: type the name of the class you want to create. For this second program, enter LetterI· Have the person not owning the account write the code for a solution to WholesaleCost· Test LetterI until the program is correct3) LetterI with a Grid Object: You need to add Grid.java to your project. You need Grid.java in your projectWrite a Java program that constructs a 14-by-9 Grid and then instructs the mover to “draw” the letter I exactly asshown below. You should see the mover move. You should see this graphical view when the mover has completeddrawing an I. Here is the constructor you will need in your main method to place the mover two rows down andtwo columns to the right facing east (you could also use Grid.SOUTH, Grid.WEST, or Grid.NORTH) // Constructor has these five arguments: // totalRows, totalColumns, startRow, startColumn, and startDirection Grid g = new Grid(14, 9, 2, 2, Grid.EAST);4) BreadTrail with a Grid ObjectWrite a Java program that constructs a 3-by-24 Grid object with the mover in row 1, column 0. Then instruct the mover to leave the pattern ends like this. The constructor is Grid g = new Grid(3, 24, 1, 0, Grid.EAST);Messages you will need to solve this problem: g.move(); g.turnRight(); g.turnLeft();are summarized in Grid.htmlAnother message you will need:


View Full Document

UA CSC 127A - Objects

Documents in this Course
Load more
Download Objects
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Objects and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Objects 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?