Write an algorithm inputs speed of cars using pseudocode, Data Structure & Algorithms

Assignment Help:

Write an algorithm by using pseudocode which:

  • Inputs top speeds of 5000 cars
  • Outputs fastest speed and the slowest speed
  • Outputs average speed of all the 5000 cars

fastest = 0: count = 0

slowest = 1000

repeat

input top_speed

total = total + top_speed

if top_speed > fastest then fastest = top_speed

if top_speed < slowest then slowest = top_speed

endif

endif

count + count + 1

until count = 5000

average = total * 100/5000

print fastest, slowest, average

 


Related Discussions:- Write an algorithm inputs speed of cars using pseudocode

Define queue, A queue is a, FIFO (First In First Out) list.

A queue is a, FIFO (First In First Out) list.

Compare and contrast various sorting techniques, Q. Compare and contrast va...

Q. Compare and contrast various sorting techniques or methods with respect to the memory space and the computing time.

Write an algorithm insert, Q. Write an algorithm INSERT which takes a point...

Q. Write an algorithm INSERT which takes a pointer to a sorted list and a pointer to a node and inserts the node into its correct position or place in the list.  Ans: /* s

Threaded Binary Tree, If a node in a binary tree is not containing left or ...

If a node in a binary tree is not containing left or right child or it is a leaf node then that absence of child node can be represented by the null pointers. The space engaged by

SORTING ALGORIthm, the deference between insertion,selection and bubble sor...

the deference between insertion,selection and bubble sort

Infix notation to postfix notation, Which data structure is required to cha...

Which data structure is required to change infix notation to postfix notation?    Stack function is used to change infix notation to postfix notatio n

Program, What is a first-in-first-out data structure ? Write algorithms to...

What is a first-in-first-out data structure ? Write algorithms to perform the following operations on it – create, insertion, deletion, for testing overflow and empty conditions.

Sorting algorithms, Sorting is significant application activity. Several so...

Sorting is significant application activity. Several sorting algorithms are obtainable. But, each is efficient for a specific situation or a specific kind of data. The choice of a

Graphs, In this unit, we will describe a data structure called Graph. Actua...

In this unit, we will describe a data structure called Graph. Actually, graph is a general tree along no parent-child relationship. In computer science, Graphs have several applica

Write Your Message!

Captcha
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