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 18:30
Kto rozmawia z clamentain przez krótkofalówke w the walking dead w 4 epizodzie
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
What does the faves button do? a. users mark a web page as a favorite b. leads other readers to favor a specific page c. readers sort and align their favicons, or favorite icons d. leads users to a message board where they can post questions
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
In which of the following ways can using test-taking tips you? a. you can focus on the information that you need to study. b. you will see the answers to the test. c. you will study more. d. you will be less organized.
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
What software programs are used to to create professional publication? a.) graphics programs b.) word processors c.) page layout programs d.) spreadsheet programs
Answers: 2
You know the right answer?
// Marian Basting takes in small sewing jobs.
// She has two files sorted by date.
// (T...
Questions
question
Chemistry, 04.12.2020 01:30
question
English, 04.12.2020 01:30
Questions on the website: 13722360