Question: This assignment requires only a pseudocode solution and is worth 35 points. Assume that a file named numbers.dat containing a series of integers exists on


This assignment requires only a pseudocode solution and is worth 35 points. Assume that a file named "numbers.dat" containing a series of integers exists on the computer's disk. Design a program that reads and displays all of the numbers stored in the file and calculates their total. Be sure to use the data types and commands as presented in the module slide content, including the use of correct syntax. Use a named constant for the file name. Hint: you'll need an accumulator for this problem. Attach and submit your pseudocode to this assignment. Do not submit a flowchart or Java file. Sample output: Reading file numbers.dat Read 3 Read 2 Read 5 Read 2 Read 6 Done reading numbers, your total is 18 Input file closed// A program that reads and displays all the number stored in a file // calculates their total Module main() // constant Constant String FILENAME = "numbers.dat" // variables Declare Integer total = 0 Declare Integer num // declare input file Declare InputFile numberFile // open input file Open numberFile, FILENAME O // Display "Reading file numbers.dat Display "Reading file ", FILENAME // Read items in the file and display them While NOT eof(numberFile) total = total + num Read numberfile num Display "Read " , num End While // close output file Close numberFile // show total of numbers after done reading Display "Done reading numbers, your total is " , total Display "Input file closed" End Module
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
