Client class to test implementation of the vector class

Assignment Help JAVA Programming
Reference no: EM13163848

This programming project was given to us. We are expected to sumbit two files: Vector3D.java and Vector3DTester.java

I understand what needs to be done conceptually, but am unsure where to begin. Any help is much appreciated.

Write a client class to test your implementation of the Vector3D class that

you implemented. Name the package in which this class is defined (project

name) vector3dapp.

 

1. Using an object of the Scanner class, your program will prompt the

user for the ?rst, second and third components of three 3-d vectors,

say v1, v2, and v3. Your program will then create three 3-d vectors

using these values.

2. Your program will then display v1, v2, and v3.

3. Your program will compute and display v1 + v2.

4. Your program will compute and display (v2 + v3) v1.

5. Your program will compute and display v1 × (v2 ? v3).

6. Your program will compute and display (v2 ? v3) × v1.

7. Your program will compute and display |v1 × v2| and |v2| |v1|.

8. Your program will compute and display v1×v2

|v1×v2|

.

9. Your program will compute and display v1 × (v2 + v3).

10. Your program will compute and display (v1 × v2) + (v1 × v3)

 

 

A typical program interaction would be:

Sample Run:

Enter the components of the first 3-d vector-> 1.1 2.1 3.1

Enter the components of the second 3-d vector-> 2.2 3.2 1.2

Enter the components of the third 3-d vector-> 3.3 1.3 2.3

v1 = <1.100000,2.100000,3.100000>

v2 = <2.200000,3.200000,1.200000>

v3 = <3.300000,1.300000,2.300000>

v1 + v2 = <3.300000,5.300000,4.300000>

(v2 + v3) * v1 = 26.350000

v1 x (v2 - v3) = <-8.200000,-2.200000,4.400000>

(v2 - v3) x v1 = <8.200000,2.200000,-4.400000>

|v1 x v2| = 9.285473 and |v2||v1| = 15.861891

(v1 x v2) / (|v1 x v2|) = <-0.796944,0.592323,-0.118465>

v1 x (v2 + v3) = <-6.600000,13.200000,-6.600000>

(v1 x v2) + (v1 x v3) = <-6.600000,13.200000,-6.600000>

Reference no: EM13163848

Questions Cloud

Design a java program that simulates a slot machine : Design a java program that simulates a slot machine. When the program runs, it should do the following: Ask the user to enter the amount of money he or she wants to insert into the slot machine. ? Instead of displaying images, the program will random..
Characteristics of quicksort : familiarize  with the performance characteristics of Quicksort under normal and worst case conditions. The assignment will require some programming and interpretation of the results.
What is the total amount paid by the corporation : A U.S. corporation has purchased currency call options to hedge a 70,000 pound payable. The premium is $.02 and the exercise price of the option is $.50. If the spot rate at the time of maturity is $.65, what is the total amount paid by the corporati..
Display the dfs starting from a specified vertex : Design and implement a driver to show the following (check for 2 graphs; 1 is provided, including the starting vertex):Display the dfs starting from a specified vertex;Display the discovery/finishing time for each node in the graph;Show the Parenthes..
Client class to test implementation of the vector class : Write a client class to test your implementation of the Vector3D class thatyou implemented. Name the package in which this class is defined (projectname) vector3dapp.
Attribute information about an array of floating point : Write a program that contains a main function and three other functions that will return various attribute information about an array of floating point
Given the following test scores and grade equivalents : Given the following test scores and grade equivalents, write a function which is passed a score, and returns a letter grade based on the score entered. A number less than 0 or greater than 100 is invalid.
Explain a network storage technology : Explain a network storage technology that can use the existing network to make data on network-connected hard disks accessible to comapny users.
Popular method used by americans : What is the most popular (frequent) method used by Americans to find information?

Reviews

Write a Review

JAVA Programming Questions & Answers

  World data app

Prepare WorldDataApp project. It implements the NameIndex portion, including creating it in SetupProgram, and searching, viewing and updating it in UserApp program.

  It should have an if statement

The following are hints given: It should have an if statement. This add method determines what number greater than or less than the other number, than it adds the positive or negative. I think this should be a private method.

  Write function in javascript to compute person-s gross pay

Write the function using JavaScript syntax to compute a person's gross pay for a week. The function should receive the number of hours worked and the rate of pay per hour.

  Minimal spanning tree decreasing edge dismissal

Minimal Spanning Tree Decreasing Edge Dismissal, Reverse-delete algorithm. Develop an implementation that computes the MST

  Write a version of sumpairs

Write a version of sumPairs  that sums each component of the pairs separately, returning a pair consisting of the sum of the first components and the sum of the second components. So basically [(3,1)(10,3)] would return (13,4).

  Create a complete java application

Create a complete Java application that meets these requirements and the program has an opening comments section (using block comments) with the file name, date, your name, and purpose of the program.

  Identify the 5 code elements

Identify the 5 code elements for a Password class. Things like: class, instance, and final variables, accessor and mutator method, public and private specifiers for methods and member variables.i need to provide detail and descriptions for each code ..

  Write a java program in a netbeans project

Write a Java program in a NetBeans project

  Implement a class quiz

Implement a class Quiz that implements the Measurable interface.

  Java threads

This is an introductory assignment on Java synchronization. You will use Java Threads while learning more about concurrency and achieving atomicity using Java’s inbuilt mechanisms.

  Image to a "black-to-green scale" image

Call a method that will change the image to a "black-to-green scale" image.

  Client server chat system

Threading and GUI design using Java's network library, threading system, and swing user interlace libraries to implement a basic chat client and saver system. Thc system will allow multiple. remote users to send and receive messages across the net..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd