Experiment one, the writing Experiment of command explanation program
First, the purpose of the experiment
(1) Master the Principle of command interpretation procedure;
(2) Master the simple Dos call method;
(3) Master C language programming preliminary.
Test methods, steps and Results
#include <stdio.h>#include<stdlib.h>#include<string.h>intMain () {Charstr[ -]; printf ("Please enter a command:"); Do{gets (str); if(strcmp (str,"dir")==0) {printf ("dir indicates no parameters: View the file currently in the directory \ n"); } Else if(strcmp (str,"CD")==0) {printf ("CD Directory Name: Enter a specific directory. \ n"); } Else if(strcmp (str,"MD")==0) {printf ("MD Directory Name: Create a specific folder. Dos under the habit called Directory, win under the habit called folder \ n"); } Else if(strcmp (str,"Rd")==0) {printf ("Rd Directory Name: Deletes a specific folder. \ n"); } Else if(strcmp (str,"CLS")==0) {printf ("CLS Directory Name: Indicates clear screen function \ n"); } Else if(strcmp (str,"Data")==0) {printf ("Data Set Date command, function is set date \ n"); } Else if(strcmp (str," Time")==0) {printf ("Time system Clock Settings command, function: Set or display the system period. \ n"); } Else if(strcmp (str,"Ren")==0) {printf ("Ren means that the file is renamed, and the Ren command is in the format: the file name of the Ren source file. \ n"); } Else if(strcmp (str,"Copy")==0) {printf ("Copy represents the Replication command, and the replication information for his features \ n"); } Else if(strcmp (str," Help")==0) {printf ("no parameters: View files and folders in the current directory \ n"); printf ("CD Directory Name: Enter a specific directory. \ n"); printf ("MD Directory Name: Create a specific folder. Dos under the habit called Directory, win under the habit called folder) \ n"); printf ("Rd Directory Name: Deletes a specific folder. \ n"); printf ("CLS Directory Name: Indicates clear screen function \ n"); printf ("Data Set Date command, function is set date \ n"); printf ("Time system Clock Settings command, function: Set or display the system period. \ n"); printf ("Ren means that the file is renamed, and the Ren command is in the format: the file name of the Ren source file. \ n"); printf ("Copy represents the Replication command, and the replication information for his features \ n"); } Else{printf ("you enter the wrong information, please re-enter: \ n"); } } while(strcmp (str,"quit")==0) return 0;}
Second, the experimental summary
It's a waste of time to read the wrong question.
Chapter I.