Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Homework #5 Update1 Turn In: 1. Exercise #1 Due in class on xxx, xxx xx, 2017 a) For each exercise, a hardcopy package must be

Homework #5 Update1 Turn In:

1. Exercise #1 Due in class on xxx, xxx xx, 2017

a) For each exercise, a hardcopy package must be generated to include the following items:

- Cover Sheet (use the sample copy include in class/lecture note)

- Exercise/problem statement

- Copy of your source file (Java program named as

cis36aFall2017YournameHw5Ex1.java)

- Copy of output (copy and paste to the end of your program as PROGRAM_OUTPUT

comment block)

- Copy of YOUR_Logic_Code_Issues_COMMENTS (as a separate comment block) after the PROGRAM_OUTPUT.

b) Submitting in class one hard copy for each document

c) Emailing each document as follows,

- One message for each exercise.

- Attaching the source file that was created in part a).

- The SUBJECT line of the message should have one of the following lines:

Cis36Fall2017YourNameHw5Ex1

3. Q.E.D.

1. Code Assignment/Exercise Exercise 1

A. Update the Fraction class given in the Lecture notes or as discussed in class meetings as needed.

B. Create the Point class as required below (and updated during class discussions),

/**

* Program Name: Point.java

* Discussion: Points and operations

* Date:

*/

class Point {

private Fraction fx; private Fraction fy;

// Constructors

// Operations

// Displaying

}

D. Write a menu program to first display the exercise information and output as below,

/** REQUIRED PROGRAM OUTPUT

CIS 36A Java Programming Laney College

Your Name

Assignment Information -- Assignment Number: Homework 05,

Coding Assignment -- Exercise #1

Written by: Your Name Submitted Date: Due Date

*******************************

* MENU Hw #5 *

* 1. Initializing (2 Points) *

* 2. Placement *

* 3. Moving *

* 4. Flipping *

* 5. Displaying *

* 6. Quit *

*******************************

Select an option (use integer value only): 2

Not a proper call as no Points are available!

*******************************

* MENU Hw #5 *

* 1. Initializing (2 Points) *

* 2. Placement *

* 3. Moving *

* 4. Flipping *

* 5. Displaying *

* 6. Quit *

*******************************

Select an option (use integer value only): 1 Initializing Option --

***************************

* Sub MENU INITIALIZING *

* 1. Creating *

* 2. Updating *

* 3. Returning *

*************************** Select an option (integer only): 2

Not a proper call as no Points are available!

***************************

* Sub MENU INITIALIZING *

* 1. Creating *

* 2. Updating *

* 3. Returning *

*************************** Select an option (integer only): 1

//Enter proper data to build Point objects

***************************

* Sub MENU INITIALIZING *

* 1. Creating *

* 2. Updating *

* 3. Returning *

*************************** Select an option (integer only): 3

Returning to MENU Hw#5

*******************************

* MENU Hw #5 *

* 1. Initializing (2 Points) *

* 2. Placement *

* 3. Moving *

* 4. Flipping *

* 5. Displaying *

* 6. Quit *

*******************************

Select an option (use integer value only): 5

Printing Option --

// Displaying proper values & formats!

*******************************

* MENU Hw #5 *

* 1. Initializing (2 Points) *

* 2. Placement *

* 3. Moving *

* 4. Flipping *

* 5. Displaying *

* 6. Quit *

*******************************

Select an option (use integer value only): 2 Placement Option -

The given Point objects are as follows,

// Assuming the Point objects are as below Point #1: (1/2, 2/1)

Point #2: (4/1, 1/1)

Which Point to be checked against (1 or 2)? 3 Wrong option!

Which Point to be checked against (1 or 2)? 1

With respective to Point #1, Point #2 is in Quadrant #4!

*******************************

* MENU Hw #5 *

* 1. Initializing (2 Points) *

* 2. Placement *

* 3. Moving *

* 4. Flipping *

* 5. Displaying *

* 6. Quit *

*******************************

Select an option (use integer value only): 2 Placement Option -

The given Point objects are as follows,

// Assuming the Point objects are as below Point #1: (1/2, 2/1)

Point #2: (4/1, 1/1)

Which Point to be checked against (1 or 2)? 3 Wrong option!

Which Point to be checked against (1 or 2)? 2

With respective to Point #2, Point #1 is in Quadrant #2!

*******************************

* MENU Hw #5 *

* 1. Initializing (2 Points) *

* 2. Placement *

* 3. Moving *

* 4. Flipping *

* 5. Displaying *

* 6. Quit *

*******************************

Select an option (use integer value only): 3 Moving Option -

Which Point to be moved (1 or 2)? 3

Wrong option!

Which Point to be moved (1 or 2)? 1

*****************************

* Sub MENU -- MovingPoint *

* 1. By (frX, frY) *

* 2. By fr *

* 3. Printing *

* 4. Returning *

*****************************

Select an option (use integer value only): 1

// Providing proper values & steps to move!

*****************************

* Sub MENU -- MovingPoint *

* 1. By (frX, frY) *

* 2. By fr *

* 3. Printing *

* 4. Returning *

*****************************

Select an option (use integer value only): 3

// Displaying proper values & formats!

*****************************

* Sub MENU -- MovingPoint *

* 1. By (frX, frY) *

* 2. By fr *

* 3. Printing *

* 4. Returning *

*****************************

Select an option (use integer value only): 2

// Providing proper values & steps to move!

*****************************

* Sub MENU -- MovingPoint *

* 1. By (frX, frY) *

* 2. By fr *

* 3. Printing *

* 4. Returning *

*****************************

Select an option (use integer value only): 3

// Displaying proper values & formats!

*****************************

* Sub MENU -- MovingPoint *

* 1. By (frX, frY) *

* 2. By fr *

* 3. Printing *

* 4. Returning *

*****************************

Select an option (use integer value only): 4 Returning to MENU Hw#5

*******************************

* MENU Hw #5 *

* 1. Initializing (2 Points) *

* 2. Placement *

* 3. Moving *

* 4. Flipping *

* 5. Displaying *

* 6. Quit *

*******************************

Select an option (use integer value only): 4 Flipping Option -

Which Point to be flipped (1 or 2)? 3

Wrong option!

Which Point to be flipped (1 or 2)? 2

****************************

* Sub MENU - FlippingPoint *

* 1. By Y *

* 2. By X *

* 3. By Origin *

* 4. Printing *

* 5. Returning *

****************************

Select an option (use integer value only): 1

// Providing proper values & steps!

****************************

* Sub MENU - FlippingPoint *

* 1. By Y *

* 2. By X *

* 3. By Origin *

* 4. Printing *

* 5. Returning *

****************************

Select an option (use integer value only): 4

// Displaying proper values & formats!

****************************

* Sub MENU - FlippingPoint *

* 1. By Y *

* 2. By X *

* 3. By Origin *

* 4. Printing *

* 5. Returning *

****************************

Select an option (use integer value only): 2

// Providing proper values & steps!

****************************

* Sub MENU - FlippingPoint *

* 1. By Y *

* 2. By X *

* 3. By Origin *

* 4. Printing *

* 5. Returning *

****************************

Select an option (use integer value only): 3

// Providing proper values & steps!

****************************

* Sub MENU - FlippingPoint *

* 1. By Y *

* 2. By X *

* 3. By Origin *

* 4. Printing *

* 5. Returning *

****************************

Select an option (use integer value only): 4

// Displaying proper values & formats!

****************************

* Sub MENU - FlippingPoint *

* 1. By Y *

* 2. By X *

* 3. By Origin *

* 4. Printing *

* 5. Returning *

****************************

Select an option (use integer value only): 5 Returning to MENU Hw #5

*******************************

* MENU Hw #5 *

* 1. Initializing (2 Points) *

* 2. Placement *

* 3. Moving *

* 4. Flipping *

* 5. Displaying *

* 6. Quit *

*******************************

Select an option (use integer value only): 6 Having Fun ...

Hint!

You should at least test your program with the information given below (used as pairs).

Point

#1:

(1/2, 2/1)

Point

#2:

(4/1, 1/1)

Point

#3:

(-1/1, -1/2)

Point

#4:

(2/1, -2/1)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions