Computers and Technology

// 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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:40, dkjfghdjk
In a response of approximately 50 words, explain why it would be essential for the successful a/v technician to participate in additional coursework, presentations and seminars offered by equipment manufacturers as well as annual conferences attended by colleagues in the industry.
Answers: 1
image
Computers and Technology, 25.06.2019 08:10, avalonr2003
What is the requirement for self-contained recovery devices
Answers: 1
image
Computers and Technology, 25.06.2019 09:20, bnvghnbbb
Problem 3: (hand) write the member function implementations for the class hand, which simulates a hand of 2 cards, into the file hand. cpp. the relative strength of 2 hands are determined by the following rules: • a pair (two cards of the same number) is the strongest hand. • two cards of the same suit is the next strongest hand. • two cards of different numbers and suits is the weakest hand. • within the same kind of hands, the stronger hand is determined by the larger number. • if two hands are of the same kind and the larger numbers are the same, the stronger hand is given by the hand whose smaller number is larger. • if all above fails, the two hands are of equal strength. i. e., all suits are of equal strength. • 2 is the weakest number. an ace is stronger than a king. you are using a single deck of cards. so a hand of a♥a♥ is impossible. here are some examples:
Answers: 3
image
Computers and Technology, 25.06.2019 09:30, cheesecake1919
Evaluate the following code segment. what is the value of count after execution? int count = 1; for(int outer = 0; outer < 4; outer++) for(int inner = 1; inner < 3; inner++) count++; 1 3 9 12 13
Answers: 1
Do you know the correct answer?
// Marian Basting takes in small sewing jobs.
// She has two files sorted by date.
// (T...

Questions in other subjects:

Konu
Mathematics, 03.07.2019 15:00