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

  Java program that allows the user to enter a letter

Write a java program that allows the user to enter a letter (as a code) and a real number (as the radius of a circle). If the letter is 'A' your program must calculate the area of the circle. If the letter is 'C' your program must calculate the ci..

  Simulate some people catching fish in a lake in java program

In this project, you will simulate some people catching fish in a lake. The purpose of the assignment is to get used to using Arrays as well as getting more experience in having objects interact together.

  Create the working applet to compute tax

Write down a java applet. Your applet assits to find out how much federal tax we require to pay suppose the tax rate is 12%. Create and implement the working applet to compute tax.

  Write a class that implements an ordered list of strings

In this problem you will write a class that implements an ordered list of Strings.

  Your letterinventory class must use an array

Your LetterInventory class must use an array of Counter objects. Note that there is no nextChar method in the Scanner class. You must use the next() method and then use a loop through the characters of the token that is returned. Ignore any character..

  How to count number of objects (instances) created

How to count number of objects (instances) Created, use java code and please be descriptive

  Write a program that prompts the user to enter an integer

Using && and || write a program that prompts the user to enter an integer and determine whether it is: Evenly divisible by 5 AND 6.

  Develop a program that will handle a golfer and his scores

develop a program that will handle a Golfer and his scores. The program will be comprised of two classes: a Golfer class that will manage all the golfer's scores and a Score class.This is a class designed to represent a golfer including his name, hom..

  An elementary calculation yields the result

An elementary calculation yields the result that theoretically, the probability of turning up 7 when two dice are thrown is 1/6, or .166666. But what if more dice are thrown? If 3 dice are thrown, what is the probability that some 2 of three sum to 7..

  Determine java application on web and structure functions

Determine the Java application on Web and explain how program structure functions. Explain the application in as much detail as possible.

  Compute area and perimeter of a polygon

Create a project that would let a user compute area and perimeter of a polygon

  Java program to store temperatures in two-dimensional array

Write the Java program which uses two-dimensional array to store highest and lowest temperatures for each month of the year. Program must output average high,average low,

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