subject

// Marian Basting takes in small sewing jobs.
// She has two files sorted by date.
// (The date is composed of two numbers -- month and year.)
// One file holds new sewing projects
// (such as "wedding dress")
// and the other contains repair jobs
// (such as "replace jacket zipper").
// Each file contains the month, day, client name, phone number,
// job description, and price.
// Currently, this program merges the files to produce
// a report that lists all of Marian's jobs for the year
// in date order.
// Modify the program to also display her total earnings
// at the end of each month as well as at the end of the year.
start
Declarations
num newMonth
num newDay
string newName
string newPhone
string newDescription
num newPrice
num repairMonth
num repairDay
string repairName
string repairPhone
string repairDescription
num repairPrice
num newDate
num repairDate
string bothAtEof = "N"
num HIGH_MONTH = 99
InputFile newJobs
InputFile repairJobs
getReady()
while bothAtEof = "N"
detailLoop()
endwhile
finish()
stop

getReady()
open newJobs "NewJobs. dat"
open repairJobs "RepairJobs. dat"
input newMonth, newDay, newName, newPhone,
newDescription, newPrice from newJobs
if eof then
newMonth = HIGH_MONTH
endif
input repairMonth, repairDay, repairName, repairPhone,
repairDescription, repairPrice from repairJobs
if eof then
repairMonth = HIGH_MONTH
endif

if newMonth = HIGH_MONTH AND repairMonth = HIGH_MONTH then
bothAtEof = "Y"
endif
return

detailLoop()
newDate = newMonth * 100 + newDay
repairDate = repairMonth * 100 + repairMonth
// This arithmetic turns each date into a 3- or 4-digit number
if newDate > repairDate then
output repairMonth, repairDay, repairName, repairPhone, repairDescription, repairPrice
input repairMonth, repairDay, repairName, repairPhone,
repairDescription, repairPrice from repairJobs
if eof then
repairMonth = HIGH_MONTH
endif
else
output newMonth, newDay, newName, newPhone,
newDescription, newPrice
input newMonth, newDay, newName, newPhone,
newDescription, newPrice from newJobs
if eof then
newMonth = HIGH_MONTH
endif
endif
if newMonth = HIGH_MONTH AND repairMonth = HIGH_MONTH then
bothAtEof = "Y"
endif
return

finish()
close newJobs
close repairJobs
return

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
Which is a false statement considering copyright law? a. when people upload something to the internet they automatically receive a copyright for the work b. the work does not have to contain a copyright notice to be considered having a copyright c. copyright is legal term describing rights given to the creators for literary and artistic works d. personal pictures are always covered by copyrights
Answers: 1
question
Computers and Technology, 22.06.2019 10:00
According to alisa miller foreign news bureaus
Answers: 3
question
Computers and Technology, 22.06.2019 11:00
The editing of digital photos us about the same level of difficulty as editing an analog photo
Answers: 2
question
Computers and Technology, 23.06.2019 00:10
My has been slow anyone else’s ?
Answers: 1
You know the right answer?
// Marian Basting takes in small sewing jobs.
// She has two files sorted by date.
// (T...
Questions
Questions on the website: 13722361