subject

A radar speed gun is a device used in law-enforcement to measure the speed of moving vehicles in miles per hour. The measured speeds are supposed to be stored in a file, one number per line, as follows: 65.6 , 70.2, 54.9. Unfortunately, due to an intermittent fault, occasionally multiple numbers are written on a single line as follows:73.2 , 65.6 , 69.8. Furthermore, occasionally the radar gun outputs a single stray character such as: 67.9z, 6$4.9, or a3.9, to illustrate just a few. Given a file that has radar speed gun readings, write a function averageSpeed() to calculate the average of the numbers in the file. Your code must adhere to the following specifications:a. Prompt the user for the name of the input file to process. When the user enters a nonexistent file name, give the user a second chance. After two wrong entries in a row, quit the program with an appropriate message. b.Ignore numbers containing stray characters. c.Ignore any reading for slow vehicles moving at 2 miles per hour or le

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 04:31, hargunk329
Q13 what function does a security certificate perform? a. creates user accounts b. scrambles data c. identifies users d. creates password policies e. provides file access
Answers: 1
image
Computers and Technology, 23.06.2019 05:00, sharkboy578
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
image
Computers and Technology, 23.06.2019 13:00, jaelynnm
Donnie does not have powerpoint. which method would be best for elana to save and share her presentation as is? a pdf a doc an rtf a ppt
Answers: 3
image
Computers and Technology, 25.06.2019 04:10, val926
While creating a web page, what does each of the following html tags define? 1. 2. 3. 4. a. defines a new paragraph b. defines a term c. defines a single line break d. defines a heading
Answers: 1
You know the right answer?
A radar speed gun is a device used in law-enforcement to measure the speed of moving vehicles in mil...

Questions in other subjects:

Konu
Mathematics, 16.04.2020 00:03
Konu
Mathematics, 16.04.2020 00:03