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

  Problems on oops

Problems on OOPS

  Write a program that reads from a file a list of course name

Write a program that reads from a file a list of course names, letter grades for each course and number of credits each course is worth. The program will read each course name, grade earned and number of credits from the file and print out the course..

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

  Build a traffic light system - microcontroller system

Build the whole system with 3 RAG units and three puffin crossing units and build a team to work on this mini-project, be careful in selecting your team member.

  First display the smallest volume and then the largest volum

first display the smallest volume and then the largest volume.

  Displays columns titled "name", "quantity", "price", value

Write a program that displays columns titled "Name", "Quantity", "Price", and "Value". The fourth column contains the result of multiplying each item's quantity by its price. In addition, the program should calculate and display the total value of th..

  Three or more dimensions

What kind of program, or problem, might necessitate arrays of three or more dimensions?

  Write program which prompts user to enter numbers

Write down the program which prompts the user to enter numbers, findsout how many positive and negative values have been entered, and calculates sum and average of numbers entered.

  We wish to process survey results

Suppose we wish to process survey results that are stored in a file. This exercise requires twoseparate programs. First, create a program that prompts the user for survey responses and outputseach response to a file

  The first will be a structure called point

Create two structures. The first will be a structure called Point and will have as its data members an x and y coordinate. The second will be called Line and will have two Point structures as its data members.

  Value of x after the following code is executed

What will be the value of x after the following code is executed?int x = 20, y = 30;while (y

  Write c program that prompts for variable number of integers

Write a C program that prompts for a variable number of integers, adds them up, averages them, and prints out the average.

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