Basic Algorithm
Words: 275
Pages: 1
120
120
DownloadBasic Algorithm
Name
Institutional Affiliation
Declare InputFile myIFileDeclare OutputFile myOFile
Declare Real bookPrice[5]
Declare Real Sum
Declare Integer K, N
Set K = 0 Set Sum = 0
//Open input file that stores a list of prices for the books Open myIFile “bookPriceList.dat”//
While loop to read prices in the file to array bookPrice[K]
While K < 5 and Not endof(myIFile)
Read myIFile bookPrice[K]
K++
End While
// Close input file
Close myIFile // Open output file to store the values in the array
Open myOFile “arrayValues.dat”// For loop to sum the total and write value of array to output fileFor N = 0 to K -1Set Sum = Sum + bookPrice[N]Write myOFile bookprice[N]End For loop// Close output fileClose myOFile210502559055Declare InputFile myIFileDeclare OutputFile myOFileDeclare Real bookPrice[5]
Declare Real Sum
Declare Integer K, N
00Declare InputFile myIFileDeclare OutputFile myOFileDeclare Real bookPrice[5]
Declare Real Sum
Declare Integer K, N
297180072390
center10795Set K = 0
Set Sum = 0
00Set K = 0
Set Sum = 0
2962275128905
236220028575Set K = 0
Set Sum = 0
00Set K = 0
Set Sum = 0
29432252139952962275147320
3905250171450True
0True
1638300200025False
False
210502529210K<5 and not eof(myIFile)
00K<5 and not eof(myIFile)
381952514732016383001473203267075283337032480252214245981075315722099060023856954000502905125Chose myOFile00Chose myOFile100012514617704000501776730N < K
00N < K
1009650956945101917529972046863001299845Set K = K + 1
00Set K = K + 1
right671195Read myIFile bookPrice[K]
00Read myIFile bookPrice[K]
26193753090545Set N = N + 1
00Set N = N + 1
23336252528570Write myOFile bookPrice[N]
00Write myOFile bookPrice[N]
23329901918970Set Sum= Sum + bookPrice[N]
00Set Sum= Sum + bookPrice[N]
3524253776980End
End
4286251209675N=0
00N=0
428625571500Open myOFile ‘arrayValues.
Wait! Basic Algorithm paper is just an example!
dat’
00Open myOFile ‘arrayValues.dat’
4476759525Chose myIfile00Chose myIfile
513397593980
1000125122555
160972550800True
0True
160972545720
Subscribe and get the full version of the document name
Use our writing tools and essay examples to get your paper started AND finished.