Thread: Modular Programming Help

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    43

    Modular Programming Help

    Hello, just wondering if anyone could help with me a piece of code

    Code:
    #include <stdio.h>
    #include <ctype.h>
    
    void step1()
    {
        printf("You have 3 choices\n");
        printf("Enter a for Student Name\n");
        printf("Enter b for Tutorial Time\n");
        printf("Enter a number to display positives\n");
        printf("Press q to quit\n");
    
        scanf("%c", &letter);
        printf("Input = %c\n", letter);
        return;
    }
    
    
    void step2()
    {
    
        switch(response)
    	  {
    		case 'a':
    		  printf("Name\n");
    		  break;
    
    		case 'b':
    		  printf("Date\n");
    		  break;
    
    		case 'c':
    
    
    		case 'q':
    		  break;
    
    		default:
    		  printf(“You haven't selected a valid option.\n”);
    		}
    
    	} while(response != 'q');
    
    }
    
    
    int main()
    {
        char letter
    
        step1();
    
       return(0);
    
    }

    I need to display a menu then once the user inputs an option it goes on to step 2. Step 2 is a switch case scenario. Just wondering if I am on the right track?

    also the scanf in step 1 doesn't work for some reason :/ it keeps coming up with an error.

    Don't worry about case 'c' and such yet, I haven't started that section
    Last edited by DJ_Steve; 09-08-2009 at 11:42 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. modular c programming
    By akrlot in forum C Programming
    Replies: 5
    Last Post: 10-25-2007, 07:00 AM
  2. Modular
    By loopshot in forum Game Programming
    Replies: 7
    Last Post: 01-20-2006, 07:24 PM
  3. Modular math
    By PJYelton in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 10-01-2003, 08:35 AM
  4. Modular Division problem
    By Malek in forum C++ Programming
    Replies: 7
    Last Post: 05-24-2003, 06:08 PM
  5. Completely modular motherboards?
    By SMurf in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 02-23-2003, 12:56 PM