Can someone help!

Hello there, I have a project due on the 11th of May. The problem is simple, I dont know how to do this program and pretty much most of the class. Because my teacher is chinese and I dont understand what their talkin about because of their accent. It leaves me no choice but to take my chance in here. I dont even know how would I do this program. Can someone help me how to do this program.

Multiple Record Types/Look Ahead 241
CHAPTER 6
PROGRAMMING ASSIGNMENT 1
INSTRUCTIONS
Write the RPC program to prepare a Payroll Report. The input card contains the Employee
Number, Employee Name, Regular Earnings; Overtime Earnings, and a Code which indicates
whether the employee worked first, second, or third shift. If first shift is worked, there is no
bonus; if second shift is worked, there is a bonus of $5.00 and if third shift is worked, there is a
bonus of $10.00. If a valid code is not found in the input record, the message INVALID SHIFT
should be printed. The Total Earnings is calculated by adding the Regular Earnings, the 'ji ~
Overtime Earnings, and the Bonus. II
INPUT
-.
EMP EMPLOYEE REG OVT
NO NAME EARN EARN
DDO DOOOOOODODDOODaooaa oooaaoaoooooOOOOOODGGOOUUDDDDDDOUDuDDODUUD '., """"..,..,.."."" """""","""", """ n""".""""""""." """"".
111 1111111111111111111 11111111111 11111111111111111111111111111 , 1 ,
222 2222222222222222222 2222222222222222222222222222222222222222222
333 3333333333333313333 3331333333333333333333333333333333131333333
444 4444444444444444444 4444444444444444444444444.44444444444444444 4
555 5555555555555555555 5555555555555555555555555555555555555555555 5 ""
666 6611611156651565'65 5'565665.1556&5566155665616'5655561556551'5 5
777 7777777777777777777 7777777777777777777777777777777777777717171 1
.ID DDD'DD"'I"SD""D I"""DD'IIIIDDI'DD"I'IDIIIID"I"'III"D ,
", 9999""""""9" 9'9"99999999""9"'9'9'9'9""'999""'" , ", """".",.,.."""" ~"""".""M"""M"""'!""""""""""U"""""""""""""""
.'I!, ..
OUTPUT
The output from the program is illustrated below.
PRINTER SPACING CHART "1: ;,
I.
19
90
I
I
I
I
14
IS
I'
17
242 Computer Programming RPG II
CHAPTER 6 .
PROGRAMMING ASSIGNMENT 2 i
INSTRUCTIONS
Write the RPG program to produce the Daily Sales Report. '"
INPUT -Salesman Name Cards and Sales Cards
Input is to consist of two types of cards for each salesman: A Salesman Name Card and a
Daily Sales Card reflecting the Amount sold to each customer contacted for the day. There is
one Salesman Name Card for each salesman. This card is identified by a "1" control punch in
card column 80. There may also be one or more Daily Sales Cards for each salesman. These
cards will be identified by a "2" control punch in column 80. The possibility also exists that
there will only be a Salesman Name Card and no Daily Sales Card. The format of the cards is
illustrated below.
. z CUST SALES
~ DATE' AMT
VI
00 00000 0000 000O:OOOOOOOOOOOgOOOOOOOOOOOOGOOOOO09000000000000000000000'000000 , " .,." """i, ..,,~. """,." """ " ""n" "...n ""...,.,.,.,.."""""n"",,'",."".."..,' ""nn" ~n , I
;: CUST SALES ~Z
~ DATE' AMT 3
DO 00000 000 0 ~O 0 0 ~O 0 0 0 0 0 0 0 0 0 0 gOOD 0 0 0 0 0 00 0 0 0 0 0 00 0 0 9 0 00 0 00 0 0 0 0 00 0 0 0 0 0 0 0 0 00 0 P 0 0 0 0 0 'I ..", """" .,,"~. """"",.""'.""n,,.,-..n' ..""...,..., ,."""""""",."..""u,,~., "" n 4
'1 1 5
; SALESMAN Z &
a NAME 3
00 00000000000000000JOOOOOOOOgOOOOOOOOOOOOOOOOOO09DOOOOOO0000000000000000800000 1 NOTE: A "2" control
",."" ".""" ~"'n",.""",;",,"n":'...""""""""""""""'""""""".""".."..., "..nn "" n 4, punch in card column 80
11 1111111 1111 11 11 I 11 1111 111111111111111 I 1111 I 11 111 111 , 111111 11 1 111111 1 111 l' 1 I 1 5 identifies the Daily Sales
,
12 22Z222222222Z222Z '22Z22Z22Z22ZZZlZ22ZlZlZZZZlZl2Z2ZZZZZ2;2222Z2222l222l22Z2 2 / Cards 6
33 33333333333333333 1333333333333333333111111:13131113111311113111111113311331 1 1
444144444444444444444 444444444444444444444444444444444~44444444444444444444444 4, NOTE: A "1" control punch in
55~55555555555555555 5555555555555555555555555555555555555555555555555555555555 card column 80 identifies the
, Salesman Name Cards
66SI6111&&&6&&&&&&&& 616&&&&&66&&&&&&&&1&15;61&1&1&1&6&1&&&&&1&&&&1&&&1&&&&1&& I ./
1J JJJJJ11111111JJJI JJllJJ1J1111111111JJJJ1JJ1JJ1JJJllJJ1J1J111111111111J11Jl 1
'I ""'11111111'1" "1'111'11"11111'1'1'1"111111111'11111111'1111'11111.11 I
'9 99'99"""'9"99 """""""""9'99999999'9999"9"'9""""i"'"'" , """"""",".""."",""""""."""""""."""""""." """"""..".""".""u "..,...""n..."n." /~
Multiple Record Types/Look Ahead 243
OUTPUT -Daily Sales Report
Output is to consist of a Daily Sales Report listing the Salesman Number and the Salesman
Name from the first card. The Date, Customer Number I and Sales Amount are to be printed for
each of the Daily Sales Cards. Note that the Date, which will be identical for each of the Daily
Sales Cards, is to be printed only on the first line for each Salesman. If there are no Daily Sales
Cards for the Salesman, the message "NO SALES" should be printed adjacent to the Salesman
Number and the Salesman Name.
PRINTER SPACING CHART
I I I I 7777777777 1""""" I' 17.'OIZS4!I7.'OIZS4!I7.'O 'j I. ,
If I
Jii
I
r
Hint: The date field will be available when the Salesman Name Card is printed by looking
Ahead at the date in the first Daily Sales Card. look Ahead fields can be specified on the
Output Specifications as well as the Calculation Specifications.
~t, .
,
1 "
~, .,
,
.,;. :,
'.' ' ~. , '
.I'
t
I
" I
! , .
-'". !
;
244 Computer Programming RPG II
CHAPTER 6
PROGRAMMING ASSIGNMENT 3
INSTRUCTIONS
Write the RPG program to process Physical Inventory records and create a Physical
Inventory Report. A Physical Inventory consists of a count of the number of parts a company
currently has. These parts may be in one of three conditions: Raw Material, Work in Process,
or Finished Goods. When the part consists merely of Raw Material, then no work has been done
to build the part. When a part is in Work in Process, it is in the process of being built. Finished
.' , Goods means that the part has been completely built and is ready to be sold to a customer. Test
.; data is contained in Appendix E.
:.:~tr:!"'.I: ';'J;i~};';; INPUT -Physical Inventory Cards
",~.';~jr1;f;
~i.:~J!~,~~: The Physical Inventory ~ards consist of three types-one for the Raw Material Count, one
' ~i'~r!: for the Work in Process Count, and one for the Finished Goods Count. The format of these cards
...~c1!;i"';"i6i,
"i l"W::!~~::~i:, is illustrated below.i;
,;: '!Jt~; ,;;"'; tre':f r".";';!'~
I'.i l' ~, '!: i"";iI"t."m C~-- ,. "' ':, "io, .. !~'W !a~t..j~ FInished c"c:;"r'fj"Ji~j,ic:::;l, ' Goods
".,,~~"~~ ' q~i
;,c:;}i:~,j~~;;{,;;1'~ "3" 000000000000000000000000000000000000:0000 00 0000000000000000000000.
;";t",;~'~r~:,I;;, ."" """.." ""."""" ".. ,..." , "" "..", ".."... ~nnn..,,~n~ ..!,,'c:tif)j~.,:,(Jr
111111111111111111111111111111111111111111111111111111111111111111111
i,"i;;~~;gi'; 2222222!2 22:22222222222222222222222222222222222222222222222222222222 2
;! '::~~1;~!:.~~:@--orktn--""fun,,' Process Ho Hum'" i ,"'" I.
.~
" ,,0 ~ 2 00 00000 00000000 ooooooooooo~ooooaaoaaaaaaaooo, a a oaa oaaao 0
'I"""""" ..'" ...""n""""""~"""""..."".",,,,""""""""""""'JM"""""...,.." nnn.."."".. 6
I 1 1 111 1 1 1 I 11 1 111 11 11 1 1 1 111111 1111 I 1 111 11111111 11 111 1 , 1 1 1111 11111 I 111 111 111111 1 1
12122222 21112 2!2 2 222212222222222222222222222222222222222222; 222222222222222222 2 )
I @ --)3 Raw z, " 9 Do,I "" ~ Un" ' 4 ..
Material Ho Hum'" 0 "oco I.
.~ "1" 0 ~ ~
DO aaaaa COO DaD aaaaaaooao09aaaaaaaaaoaaa"oo ao 0
",.."".""'.n.,."""n..n"""""""""".".""."""""""""."""",..""",...",...n..,,...,.n,,"""""" 6
1111111 111 1111111111111111111111111111111111111111111111111111111111111111 1
) 112 2 2 2 2 212 ~2 2 2 222: 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2; 2 2 22222222222222222; 2222! 12 2 2 2 2 2 2 2 2 2 2 2 2 )
J J 3 3 3 3 3 3 3 J 3 3:333333333333333333! 333133333333) 3 3 3! 3 ! 3! 3 3 3 3 3 3 333333333 ! 3 3 3 3 3 3 3 J 3 :
44444444 444 4 ~4 4 4 4444444444444444444444444444444444444444444444444.44 4 4 4 4 4 4 4 4 4 4 "
~ ~ ~ ~: ~ ~ ~ ~"5I ~ ~ ~ ~; ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ s ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 5 5 ~ ~ ~ ~ ~ ~ ~ ~
66666611 666 ~66666665~66616S6661ISS'16SllliS~SIIISI6611ISISSSIS6S1IIISS6S1116 6
111)~)))))))) 1)))))))))))) 1)))))))) 1) 1)))) 11) 1)))))))) J))))),))))'))) )
I III ~II! IIIIIIIIIII ! IIIIIIIIIIIIIIIIIIIIIIIIIIII ~ IIIIII , IIIIII IIIIIII I
~ ~,~, ~9, ~ ~ 9 9,~~, ~I!';~~~'~~~~~ ~,~,~.~~~ ~~!,~,~~,!!.Z~,~,~~~,~~.~,~~I.~~.,9,~,~~!~,Z~~~~ ~ ~I~'~~~! ~ ~
~
"",-
.,,:
Multiple Record Types/Look Ahead 245
Note from the card formats that each contains a type code in column 80 to identify the type
of card being processed. Note also that the number of decimal places to the right of the decimal
point in the unit prices is different dependent upon the type of record being processed. For Raw
Material, the unit price has the format X.XXXX, for Work in Process the format is XX.XXX, and
for Finished Goods, the format is XXX.XX.
OUTPUT -Physical Inventory Report
There is one card per part number for each type. Thus, there would be one raw material card
for part number 996543, one Work in Process card for part number 996543, and one Finished
Goods card for this part number, Note, however, that there need not be all three cards, that is,
one part number may only have a card for Finished Goods. :'1
, till
The report is to have the department number group indicated and the part number group '! '.1
printed, The print line is to have the total amount for each of the three categories. The total
amount is determined by multiplying the unit price in the card input by the quantity in the card
input, Note that all values on the report are specified as dollars and cents. ij:'i
I
""'0
""'0
,
2
'I ',"II
,
, i!
1
1
1
1
1 ~"
;15 IIII
11'
.,
""111
i.r:8
,

Comments

  • [b][red]This message was edited by HK_MP5KPDW at 2004-4-29 9:45:16[/red][/b][hr]
    : Hello there, I have a project due on the 11th of May. The problem is simple, I dont know how to do this program and pretty much most of the class. Because my teacher is chinese and I dont understand what their talkin about because of their accent. It leaves me no choice but to take my chance in here. I dont even know how would I do this program. Can someone help me how to do this program.

    [blue]With such a badly formatted thread, it would be hard for many to be bothered with taking the time to read this and respond. You seem to have multiple program you want help with completing. All the other programs seem roughly similar to the first one, ie. read a file, do stuff, output to screen or another file. Once you have the first one down you should have a good idea on how to do the others.

    Are there certain parts you are having difficulties with? I.e. file i/o or something else. Is this supposed to be C or C++? Do you simply have a difficult time understanding programming?[/blue]
    :
    : Multiple Record Types/Look Ahead 241
    : CHAPTER 6
    : PROGRAMMING ASSIGNMENT 1
    : INSTRUCTIONS
    : Write the RPC program to prepare a Payroll Report. The input card contains the Employee
    : Number, Employee Name, Regular Earnings; Overtime Earnings, and a Code which indicates
    : whether the employee worked first, second, or third shift. If first shift is worked, there is no
    : bonus; if second shift is worked, there is a bonus of $5.00 and if third shift is worked, there is a
    : bonus of $10.00. If a valid code is not found in the input record, the message INVALID SHIFT
    : should be printed. The Total Earnings is calculated by adding the Regular Earnings, [red]the 'ji ~ [/red]
    : Overtime Earnings, and the Bonus. II

    [blue]What the hell does the above text in [red]red[/red] mean?[/blue]

    : INPUT
    : -.
    : EMP EMPLOYEE REG OVT
    : NO NAME EARN EARN
    : DDO DOOOOOODODDOODaooaa oooaaoaoooooOOOOOODGGOOUUDDDDDDOUDuDDODUUD '., """"..,..,.."."" """""","""", """ n""".""""""""." """"".
    : 111 1111111111111111111 11111111111 11111111111111111111111111111 , 1 ,
    : 222 2222222222222222222 2222222222222222222222222222222222222222222
    : 333 3333333333333313333 3331333333333333333333333333333333131333333
    : 444 4444444444444444444 4444444444444444444444444.44444444444444444 4
    : 555 5555555555555555555 5555555555555555555555555555555555555555555 5 ""
    : 666 6611611156651565'65 5'565665.1556&5566155665616'5655561556551'5 5
    : 777 7777777777777777777 7777777777777777777777777777777777777717171 1
    : .ID DDD'DD"'I"SD""D I"""DD'IIIIDDI'DD"I'IDIIIID"I"'III"D ,
    : ", 9999""""""9" 9'9"99999999""9"'9'9'9'9""'999""'" , ", """".",.,.."""" ~"""".""M"""M"""'!""""""""""U"""""""""""""""
    : .'I!, ..

    [blue]Is this supposed to be a sample of the input? If so it is one of the worst samples I have ever seen. Try coming up with a few lines of input of the type that you expect to be processed in the actual program and post that. For example, is it supposed to look like this:

    [code]111 Adam 123.45 23.67 2
    222 Bob 213.40 0.00 4
    333 Charlie 178.95 12.02 3[/code][/blue]

    : OUTPUT
    : The output from the program is illustrated below.
    : PRINTER SPACING CHART "1: ;,
    : I.
    : 19
    : 90
    : I
    : I
    : I
    : I
    : 14
    : IS
    : I'
    : 17

    [blue]Again, bad bad format. If this is supposed to be the teacher's idea of the output after reading the provided sample input data, I'd probably just give up and shoot myself in the head. This is awful and of no help to any of us. Write some output lines based on the suggestion I gave you regarding the input data. This will be of immense help. For example, based on my sample input do you think the output is supposed to look something like:

    [code]Code Name Total Earnings:
    111 Adam 152.12
    222 Bob INVALID SHIFT
    333 Charlie 200.97[/code][/blue]


  • HK_MP5KPDW -- I agree that this must win the awared of the worst post ever! Appears that the example input files are binary files, which of course are of no value at all to us.
  • : HK_MP5KPDW -- I agree that this must win the awared of the worst post ever! Appears that the example input files are binary files, which of course are of no value at all to us.
    :
    You almost get the impression that the example input is supposed to represent a punch card or something. Is this really a C class?
  • : : HK_MP5KPDW -- I agree that this must win the awared of the worst post ever! Appears that the example input files are binary files, which of course are of no value at all to us.
    : :
    : You almost get the impression that the example input is supposed to represent a punch card or something. Is this really a C class?
    :

    I don't think it's a C class. Off topic! how the hell do you quote material on this board other than in code tags :(

    Write the RPC program

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories