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

  Development of a simple program involving multiple classes

Development of a Simple Program Involving Multiple Classes and development of a basic Class, development of the Country and World classes

  Method to store the product of the two arrays in third array

Write a method to store the product of the two arrays in the third array

  Describe principles of data abstraction and inheritance

Study the principles of data abstraction, inheritance and dynamic binding. Use Library to get started on finding resources.You must take the terms and describe it.

  Robot preparing for competition

Create an event so that the skateboard can be controlled by game player

  Write applet which reads five numbers-draw equivalent stars

Write the applet which reads five numbers (each between 1 and 30). For each number read, your program must design line containing that number of adjacent asterisks.

  Create classes implement java interface

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

  Write a java program using array to auto-grade exams

Write a JAVA program using 2D Array to auto-grade exams. For a class of N students, your program should read letter answers (A, B, C, D) for each student.

  Java program to print strings given at command line

Write down program Average.java to print strings which it is given at command line, one per line. If nothing is given at command line, then print "No arguments".

  Java application which creates bank records

Write down a java application which creates 10000 bank records and the allow user ti enter a balance and customer account info. using a an account number.

  Write the bubble sort

The village of Marengo conducted a census and collected records that have household data, including the number of occupants in each household.

  Write a recursive public method

Write a recursive public method in our BST class that returns a reference to the information in the node containing the smallest value in the tree. The signature of the method is

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

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