Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The program below reads a file name from the keyboard which contains blood pressure records (see sample file format below), opens the file, reads the
The program below reads a file name from the keyboard which contains blood pressure records (see sample file format below), opens the file, reads the record values from the file, displays the record, counts the number of records in the file and displays the final count. Inspect the following program code and complete the program code for the required programming task. You do NOT have to rewrite the whole program. Write only the missing code. Sample file format: 120 80 125 90 import Java.util.scanner import java.io.* public class BloodPressure public static void main (String args) throws IOException int count-0; Scanner readInput - new Scanner (System.in) //Get the file name System.out.print ("Enter the file name: ") String fileName- readInput.nextLine //open the file Write Missing Code***/ Scanner myFile -new Scanner (filePtr) while myFile.hasNext )) //Read the record values /*Write Missing Code***/ //Display the record and update counter /**Write Missing Code **/ //Display the total number of records in the file Write Missing Code***/ //Close the file Write Missing Code***/
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started