Write algorithm to decide which commute is cheaper

Assignment Help Data Structure & Algorithms
Reference no: EM1368684

Write a working algorithm in pseudo code to decide which commute is cheaper:

You want to decide whether you should drive your car to work or take the train. You know the one-way distance from your home to your place of work, and the fuel efficiency of your car(in miles per gallon). You also know the one-way price of a train ticket. You assume the cost of gas at $4 per gallon, and car maintenance at 5 cents per mile.

There are 4 basic steps to good algorithm design.
Step1: Determine the inputs and outputs
Step2: Break down the problem into smaller tasks
Step3: Describe each subtask in pseudo code
Step4: test your pseudo cose by working a problem

Reference no: EM1368684

Questions Cloud

Explain spacewise efficient implementation two-stack data : Structure of such two-stack data type would consist of two arrays and two top pointers. Describe why this may not be a spacewise efficient implementation.
Relationship between level of gdp and economic well being : Discuss and explain the relationship between the level of GDP and economic well-being. What factors of well-being are missing from the GDP?
Show the negotiation tools : What negotiation tools can you find from the post of this learner. How might you prepare differently for a negotiation with them ?
Determine optimal scams need for external funds : The Optimal Scam Corporation would like to see its sales grow at 20% for the foreseeable future. Its financial statements for the current year are presented below.
Write algorithm to decide which commute is cheaper : Write working algorithm in pseudo code to decide which commute is cheaper: You wish to decide whether you must drive your car to work or take train. You know one-way distance
Calculating the dividend yield : Springsten Music Corporation earned $820 million last year and paid out 20% of earnings in dividends. By how much did the company's retained earnings increase?
Determine net initial investment : A corporation bought a machine for $100,000 four years ago. It was being depreciated on a straight line basis over five years. The company decides to replace this machine today.
Needs and expectations of customers : Bargain furniture store management - Which evaluation tools would you utilize to ascertain the needs and expectations of your customers?
Write algorithm in pseudo code for bank account : Write an algorithm in pseudo code to settle following question: A bank account starts out with $10,000. Interest is compounded monthly at 6% per year(0.5% per month).

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Explaining diffie-hellman public-key algorithm

Use the Diffie-Hellman public-key algorithm to exchange secret keys.

  Create list of major steps to follow to get input

Create a list of major steps to follow to get input, process, and output desired information (software requirements). Refine the list to include individual refined steps (algorithm).

  Explain consensus algorithm

"Consensus algorithm": A group of ten people need to decide which one flavor of ice cream they will all order, out of three options.

  Write algorithm for graph minimum number of semesters

You are given a DAG called G which is the prerequisite graph for a set of courses required for a degree. Each vertex corresponds to course. Provide a high-level description of algorithm which labels each vertex in G with minimum number of semesters..

  Algorithm to take input m constraints over n variables

For instance, the constraints x1 = x2, x2 = x3, x3 = x4, and x1 6= x4 cannot be satis fied. Give an efficient algorithm that takes as input m constraints over n variables and decides whether the constraints can be satis fied.

  Identify data structures to organize typical file cabinet

Identify at least two data structures that are used to organize a typical file cabinet. Why do you feel it is necessary to emulate these types of data structures in a computer program?

  Describe a fair coin algorithm to returns either 0 or 1

Describe a FAIRCOIN algorithm that returns either 0 or 1 with equal probability, using ONEINTHREE as your only source of randomness.

  Write algorithm in pseudo code for bank account

Write an algorithm in pseudo code to settle following question: A bank account starts out with $10,000. Interest is compounded monthly at 6% per year(0.5% per month).

  Find fraction of time during which queue grows

Suppose now there are three users. Find the probability that at a given time, all three users are transmitting simultaneously. Find the fraction of time during which the queue grows.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  Write a c++ program to find the intersection

Write a C++ program to find the intersection, A set is a collection of distinct entities regarded as a unit, being either individually specified or (more usually) satisfying specified conditions.

  Addition and subtraction of numbers in binary

Addition and Subtraction of numbers in binary and round to the nearest decimal number with three significant decimal digits

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