Will the direction and magnitude be integers or doubles

Assignment Help JAVA Programming
Reference no: EM13704475

Question 1: Recall from physics that a physics vector can be represented by a direction and a magnitude (e.g., force or distance).

Define a Physics_vector class which consists of a struct containing the direction and magnitude, and also define a function add_physics_vector that takes two physics vectors and returns their physics vector sum. 

The main should ask for 4 lines of input, the direction and magnitude of two physics vectors, and print the vector sum on two lines (direction and magnitude); repeat until the user enters a vector of

-1 -1.

As you design the program consider:

Part 1: Will the direction and magnitude be integers or doubles?

Part 2: Will the input vectors be passed by value, by reference, or by const reference?

Part 3: What will be public in the class?

Can you design the public class and implement the program?

Reference no: EM13704475

Questions Cloud

What settings are used to make that decision : What allows the IP layer to determine where to send a packet next and what settings are used to make that decision?
Design deterministic finite state transducers : Design deterministic finite state transducers that implement the subsequent context sensitive rules:
How can you acquire the digital evidence from the computer : How can you acquire the digital evidence from the computer and which methods of collection would you use and why - would you use any special tools, programs, or methods?
Calculate c with various sets of values for a and b : Even if we were to declare variables a and b as integers, why might we still need to declare c as a ?double?
Will the direction and magnitude be integers or doubles : Define a Physics_vector class which consists of a struct containing the direction and magnitude, and also define a function
Subnetting and supernetting : What are the key differences between the following two terms: subnetting and supernetting? Provide examples for each - Do you expect IPv6 will replace IPv4 completely in the coming future
What is difference between colorname0 byte and db : What is the difference between ColorName0 BYTE "New is Blue ", 0 and ColorName0 db "New is Blue ",  0 ?
Prepare a program in c++ using the class as defined : Prepare a program in C++ using the class as defined below - Then write the main program in another file that will read in some numbers and test out whether your functions all work.
Write a recursive definition that reverses the elements : Write a recursive definition that reverses the elements in intArray between low and high.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Hypothetical situation

Hypothetical Situation - A company lowers its price of an economy car a small amount   ($15,000 to $14,000) Sales go from 10,000 units to 50,000 units. Another company lowers its price on a luxury car a large amount ($80,000 to $40,000). Its sales go..

  Design a java program that has two parallel arrays

Design a java program that has two parallel arrays: a string array named people that is initialized with the names of seven of your friends, and a string array named phoneNumbers that is initialized with your friends phone numbers.

  Problem on java progamming

Which parts of the assignment were you not able to complete fully? For each, explain why you were unable to complete this part and what steps you took to attempt to complete it.

  Create application uses two-dimensional arrays

Create an application which uses 2-dimensional arrays to keep track of 5 students' grades, with each student having 3 different classes.

  Write an application bmicalc

Write an application (BMICalc) that reads the user's weight in poinds and height in inches, then calculates the Body Mass Index.

  Java is considered to be safe from buffer overflows

Java is considered to be safe from buffer overflows. Does that make it more appropriate to use as a s development language when security is concerned? Be sure and weight all if the risks involved in product development, not just the security aspec..

  Prepare a program that constructs a binary tree and

prepare a program that constructs a binary tree and traverses the tree in pre-order in-order and post-order methods.

  Correct example of inheritance

Which of the following relationships is not a correct example of inheritance?  Parent to Children  Aunt to Uncle  Grandparent to Grandchild

  Write java program to evaluate postfix expressions

Write a java program to evaluate postfix expressions containing complex numbers using a stack. This program should contain two classes.

  Design a small wbis using elements from the disciplines

Design a small WBIS using elements from the disciplines of web design, database design, software engineering and object modelling;be able to develop a small WBIS using HTML forms, Java Servlets and cookies.

  Write an application that uses string method region

Write an application that uses String method region - Matches to compare two strings input by the user. The application should input the number of characters to be compared and the starting index of the comparison.

  E-marketing-e-commerce consultant

You are an e-marketing and e-commerce consultant. Mary and Joe Johnson, the owners of Book Bunker, have hired you to help them improve their sales both online and in their store.

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