Advertisement
matthewdeanmartin

dating simulator in gnu cobol

Dec 2nd, 2022
2,774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
COBOL 0.85 KB | None | 0 0
  1. * Declare variables
  2. 01  user-name           PIC X(20).
  3. 01  partner-name        PIC X(20).
  4. 01  user-response       PIC X(20).
  5. 01  partner-response    PIC X(20).
  6.  
  7. * Ask user for their name
  8. DISPLAY "What is your name?"
  9. ACCEPT user-name
  10.  
  11. * Ask user for their partner's name
  12. DISPLAY "What is your partner's name?"
  13. ACCEPT partner-name
  14.  
  15. * Greet the user and their partner
  16. DISPLAY "Welcome, " user-name " and " partner-name "!"
  17.  
  18. * Ask user for their response to a question from their partner
  19. DISPLAY partner-name ": What do you like to do for fun?"
  20. ACCEPT user-response
  21.  
  22. * Ask user for their partner's response to the question
  23. DISPLAY user-name ": What do you like to do for fun?"
  24. ACCEPT partner-response
  25.  
  26. * Display the conversation between the user and their partner
  27. DISPLAY user-name ": " user-response
  28. DISPLAY partner-name ": " partner-response
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement