psuedo code to pascal help plz - Programmers Heaven

Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

psuedo code to pascal help plz

chevy560chevy560 Posts: 2Member
really need help with converting this psuedocode to pascal
COUNTYOGMFEE = 0
COUNTAERMFEE = 0
COUNTGYMMFEE =0
COUNTYOG = 0
COUNTAER = 0
COUNTGYM =0
YOGATTEND_FEE =0
AERATTEND_FEE =0
GYMATTEND_FEE =0
YOGMFEETOT = 0
AERMFEETOT = 0
GYMMFEETOT = 0


PRINT

Comments

  • Actor21Actor21 Posts: 35Member
    [code]
    program pseudo ;

    var { declare all variables }
    countyogfee : integer ;
    countaerfee : integer ;
    countgymfee : integer ;
    countyog : integer ;
    countaer : integer ;
    countgym : integer ;
    yogattend_fee : integer ;
    aerattend_fee : integer ;
    gymattend_fee : integer ;
    yogfeetot : integer ;
    aerfeetot : integer ;
    gymfeetot : integer ;

    mem_fee : integer ;
    attend_fee : integer ;

    name : string ;
    programs : string ;
    mem_stat : string ;

    begin
    countyogfee := 0 ; { initialize variables }
    countaerfee := 0 ;
    countgymfee := 0 ;
    countyog := 0 ;
    countaer := 0 ;
    countgym := 0 ;
    yogattend_fee := 0 ;
    aerattend_fee := 0 ;
    gymattend_fee := 0 ;
    yogfeetot := 0 ;
    aerfeetot := 0 ;
    gymfeetot := 0 ;

    write ('enter your name. to stop data entry,type stop: ') ;
    readln (name) ;
    while name <> 'stop' do begin
    write ('enter the program enrolled either gym, yoga or aerobic ') ;
    readln (programs) ;
    write ('enter memership fee for the month ') ;
    readln (mem_fee) ;
    write ('enter monthly attendance fee for the month ') ;
    readln (attend_fee) ;
    if mem_fee = 1000 then
    mem_stat := 'REGULAR'
    else
    mem_stat := 'SPECIAL' ;

    if (programs = 'yoga') and (mem_fee = 1000) then
    countyogfee := countyogfee + 1
    else if (programs = 'aerobic') and (mem_fee = 1000) then
    countaerfee := countaerfee + 1
    else if (programs = 'gym') and (mem_fee = 1000) then
    countgymfee := countgymfee + 1 ;

    if programs = 'yoga' then begin
    countyog := countyog + 1 ;
    yogattend_fee := yogattend_fee + attend_fee ;
    yogfeetot := yogfeetot + mem_fee
    end
    else if programs = 'aerobics' then begin
    countaer := countaer + 1 ;
    aerattend_fee := aerattend_fee + attend_fee ;
    aerfeetot := aerfeetot + mem_fee
    end
    else if programs = 'gym' then begin
    countgym := countgym + 1 ;
    gymattend_fee := gymattend_fee + attend_fee ;
    gymfeetot := gymfeetot + mem_fee
    end ;

    writeln ('the name of the member entered is ', name) ;
    writeln ('the status of the member ', mem_stat) ;
    writeln ('attendance fee ', attend_fee) ;
    writeln ('membership fee is ', mem_fee) ;
    writeln ('the program they paid for is ', programs) ;
    writeln ('enter your name. to stop data entry, type: stop ') ;
    readln (name)
    end ;

    yogfeetot := yogfeetot + yogattend_fee ;
    gymfeetot := gymfeetot + gymattend_fee ;
    aerfeetot := aerfeetot + aerattend_fee ;

    writeln ('the total number of members in yoga is : ', countyog) ;
    writeln ('the total number of members in gym is: ' ,countgym) ;
    writeln ('the total number of members in aerobic: ' , countaer) ;
    writeln ('the total number of members who paid for their attendance fee in yoga: ' , countyogfee) ;
    writeln ('the total number of members who paid for their attendance fee in gym: ' , countgymfee) ;
    writeln ('the total number of members who paid for their attendance fee in aerobics: ' , countaerfee) ;

    writeln ('the total fees paid in yoga is: ', yogfeetot) ;
    writeln ('the total fees paid in gym: ', gymfeetot) ;
    writeln ('the total fees paid in aerobics: ', aerfeetot)
    end.
    [/code]
Sign In or Register to comment.