Calculation the distance and time printed on the screen

Assignment Help C/C++ Programming
Reference no: EM13166036

The company wants you to write a program to navigate santa from place to place with his sleigh. The program will loop continuously(hits use a infinite while loop), accepting user input from the keyboard and calculating distances and travel times to each new destination from his current location. For this problem, you may assume that the world is laid out on a 3-D grid with the borth pole at the origin. The trip thus starts at coordinates x=0, y=0,z=0. Each new destination point is entered as a set of x,y,z corrdinates and the distance and time to that point calculated according to the formulas

Distance=((xnew-xold)^2+(ynew-yold)^2+(znew-zold)^2)^(1/2)

After each calculation the distance and time printed on the screen and accumulated to the sum of the total distance and sum of the total time. The current destination should be saved as the old postion for the next calculation. The program should be written to terminate when ever the corrdinates (0,0,0)are entered as destination, but only after calculating that distance and time and displaying the result on the screen. Prior the terminating of the program, the program should also print out the total distance and total time to screen

Reference no: EM13166036

Questions Cloud

The function should return a value : The function should return a value of 1 when it is given a valid score to process and 0 when the received value is out side of the 0-10 range. In this case it should print a waring message on the screen
Express the number of pills numerically in decimal form : A patient needs to take 375 of ibuprofen twice daily. The pills in the bottle are each 250. . How many pills does the patient need to take each time she wants the 375 dosage? Assume that these pills are scored and can be cut in half if necessary.
State process is irreversible due to frictional losses : A stream of propane is throttled from 20 bar and 518 K to 0.42 bar. This process is irreversible due to frictional losses at the nozzle.
. find all reduced relations to x^2 congruent : 1. Use (2136)^2 congruent (6109)^2 mod 13289 to find a factor of 13289. 2. Find all reduced relations to x^2 congruent 624 mod 194297 (use code if possible)
Calculation the distance and time printed on the screen : After each calculation the distance and time printed on the screen and accumulated to the sum of the total distance and sum of the total time. The current destination should be saved as the old postion for the next calculation
Determine the empirical formula of malonic acid : The elemental mass percent composition of malonic acid is 34.63% , 3.87% , and 61.50% . Determine the empirical formula of malonic acid. Express your answer as a chemical formula.
State the present flux of anthropogenic : Given that the present flux of anthropogenic Na+ into the oceans is 3.39 x 1012 mol yr-1, how long would it take to increase the concentration of Na+
Determine the empirical formula of ester : To determine the empirical formula of ester, 1.02g of the ester was burnt completely in excess oxygen. The only products formed were 2.20g of carbon dioxide and .90g water vapor. Calculate the mass of oxygen in 1.02g of the compound.
Program that allows the user to enter the type of coin : Create a program that allows the user to enter the type of coin to be evaluated and the number of coins. The program should calculate the total weight of the coins and the height of the coins when stacked. Name the program coins.py. Use the table bel..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write c program to add two integers and prints out average

Write a C program that prompts for a variable number of integers, adds them up, and prints out the average. The user will enter either an integer to be averaged.

  Program to add numbers and display sum

For each of problems write C++ code to do the required task. Receive the number and find out whether it is odd or even.

  Prepare a linear support vector machine svm

Write a computer program to prepare a Linear Support Vector Machine SVM

  Write a very basic doubly-linked list

CptS 122 Lab #2: Linked Lists ,  Along with vectors, linked lists are one of the fundamental data structures in computer science. Unlike vectors, which store information in a contiguous block of computer memory, linked lists have the potential to sto..

  Change temperature fahrenheit to celsius and kelvin

Write a program in c++ that takes the temperature in Fahrenheit and convert it to Celsius And Kelvin:

  Users to input two forces by their components

write a programm to ask users to input two forces by their components of (Fx1,Fy1) and (Fx2,Fy2) from the keyboard.call twice the function to display both magnitude and direction angle of two forces on the screen.add two forces and display both magni..

  If a class is derived protected

If a class is derived protected from a base class, explain how this affects the inheritance of all public, protected, and private members of the base class by the derived class.

  The "continue" and "break" statements

How are the "continue" and "break" statements different from the "exit" and "return" statements?

  For the employee class make

For the Employee class make sure that no person is underage or too old (less than 16 or greater than 80). Do nothing for the set function if the person's age is out of range.

  Write program to count occurrences of each word in text

Write down C++ program to read following text. Count occurrences of each word in text and keep this count in list of elements containing (word, occurrence count) pairs.

  Struct definition to represent the data of a person''s bank

Define a struct definition to represent the data of a person's bank account. There will be one string for the name, and two doubles for balance and interest rate. Declare two variables of this new type in the main function. Modify the values of each ..

  Maze program

Maze program. In this assignment you will represent a maze with a binary tree. . The starting point is node N and the ending point is node Z.

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