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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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