Você está na página 1de 1

3/13/2018 code2flow - online interactive code to flowchart converter

int numrec=0 void welcome()

struct job int opt

char fname printf("\t\t\t Welcome to Job Records ")

 20 

char lname printf("This is your main menu")   Prompting the user to select


  an option

 20 

int ID   Name of the device printf("\n\t\t Please choose from the following options\n\n")

char device printf("\t\t\t Option #1:NewRec Records \n")

 20 

char model   Replacement Part printf("\t\t\t Option #2:View Records \n ")

 50 

char repart   Replacement cost printf("\t\t\t Option #3:RecEdit Records \n ")

 50 

oat recost   Job number printf("\t\t\t Option #4:Exit\n ")

int number scanf("%d",&opt)

char stat system("cls")

 10 

input opt

 10   1   3   2   4 

void welcome() printf(" This Option NewRec records \n") printf("This options RecEdit records \n") printf("This Option view record \n")

exit(0)

void NewRec() system("pause")   Calls the NewRec function system("pause")   Calls the view function system("pause")

void RecDisplay() NewRec()   Calls the RecEdit function system("cls") RecDisplay()

void  ll() RecEdit()

void RecEdit() system("pause")

int main()   Calls the  ll function system("cls")

ll()   Calls the welcome function welcome() printf("That Option does not exist ")

welcome() void NewRec()

0 numrec++

input[numrec-1].ID=numrec+1400

printf(" ID: %d \n",input[numrec-1].ID)   Prompting  to enter  rst


  name

printf("Enter Job  rst name:")

scanf("%s",input[numrec-1].fname)

ush(stdin)   Prompting to enter last name

printf("Enter Job last name:")

scanf("%s",input[numrec-1].lname)

ush(stdin)   Prompt to enter phone number

printf("Enter the client phone number:")

scanf("%d",&input[numrec-1].number)

ush(stdin)   Prompt to enter Job device

printf("Enter the name of the Job device:")

scanf("%s",input[numrec-1].device)

ush(stdin)   Prompt to enter device model

printf("Enter device model:")

scanf("%s",input[numrec-1].model)

ush(stdin)   Prompt to enter replacement
  part

printf("Enter the replacement part:")

scanf("%s",input[numrec-1].repart)

ush(stdin)   Prompt to enter  cost
  replacement part

printf("Enter cost of the replacement part:")

scanf("%f",&input[numrec-1].recost)

ush(stdin)

printf("Record Successful Added")

void RecDisplay()

int i

system("cls")

printf("\t\t\t Displaying Information \n")

i=0

i<=numrec-1

 False   True 

void  ll() printf("\t\t* \n")*

int i printf("\t\t\t ID: %d \n",input[i].ID)

i=0 printf("\t\t\t Job Name: %s %s\n",input[i].fname,input[i].lname)

printf("\t\t\t Phone Number: %d\n",input[i].number)

i <3 printf("\t\t\t Device: %s\n",input[i].device)

 True   False 

numrec++ void RecEdit() printf("\t\t\t Model: %s\n",input[i].model)

input[numrec-1].ID=numrec+1400 int edopt,cid   Prompt to enter  the I.D of printf("\t\t\t Replacement Part: %s\n",input[i].repart)


  the Client

  Prompting  to enter  rst printf(" ID = %d \n",input[numrec-1].ID) printf("Enter ID of the record you to edit: ") printf("\t\t\t Cost of the replacement part: $%.2f\n \a",input[i].recost)


  name

printf("Enter Job  rst name:") scanf("%d",&cid) i++

scanf("%s",input[numrec-1].fname) (cid>=1400)&&(cid<=numrec+1400)

 False   True 

  Prompting to enter last name ush(stdin) printf("ID %d does not exits\n",cid) printf("Which of the following information would you like to RecEdit \n")

printf("Enter Job last name:") printf("Enter 1 to edit :First Name  \n")

scanf("%s",input[numrec-1].lname) printf("Enter 2 to edit :Last Name  \n")

  Prompt to enter phone number ush(stdin) printf("Enter 3 to edit :Phone Number  \n")

printf("Enter the client phone number:") printf("Enter 4 to edit :Job device \n")

scanf("%d",&input[numrec-1].number) printf("Enter 5 to edit :Device model  \n")

  Prompt to enter Job device ush(stdin) printf("Enter 6 to edit :Replacement part \n")

printf("Enter the name of the Job device:") printf("Enter 7 to edit :Cost of the replacement part \n")

scanf("%s",input[numrec-1].device) scanf("%d",&edopt)

  Prompt to enter device model ush(stdin) edopt

 3   2   4   1   5   6 

  Prompt to what the model of   Prompt to enter what the
printf("Enter device model:")   Prompt to what the phone printf("Change %d \n",input[cid-1401].number) printf("Update %s to- \n",input[cid-1401].lname)   Prompt to what the device printf("Change %s \n",input[cid-1401].device)   Prompt to what the name will printf("Change %s \n",input[cid-1401].fname) printf("Change %s \n",input[cid-1401].model) printf("Change %s \n",input[cid-1401].repart)
  the device will be changed   replacement part will be
  number will be changed to   will be change to   be changed to
  to   changed to

scanf("%s",input[numrec-1].model) printf("TO-") scanf("%s",input[cid-1401].lname) printf("TO-") printf("To-") printf("TO-") printf("TO-")

  Prompt to enter replacement ush(stdin) scanf("%d",&input[cid-1401].number) system("cls") scanf("%s",input[cid-1401].device) scanf("%s",input[cid-1401].fname) scanf("%s",input[cid-1401].model) scanf("%s",input[cid-1401].repart)


  part

 7 

printf("Enter the replacement part:") system("cls") printf("Record Successfully Updated \n") system("cls") system("cls") system("cls") system("cls")

  Prompt to enter  cost scanf("%s",input[numrec-1].repart) printf("Record Successfully Updated\n") printf(" I.D %d Last name has been changed to %s\n",input[cid-1401].ID,input[cid-1401].lname) printf("Record Successfully Updated\n") printf("Record Successfully Updated\n") printf("Record Successfully Updated\n") printf("Record Successfully Updated\n")


  replacement part

printf("Enter cost of the replacement part:") printf("%s's phone number has been changed to %d \n",input[cid-1401].fname,input[cid-1401].number) printf("%s's device has been changed to %s \n",input[cid-1401].fname,input[cid-1401].device) printf("I.D %d First name has been changed to %s\n",input[cid-1401].ID,input[cid-1401].fname) printf("Device Model for %s has been changed to %s \n",input[cid-1401].model) printf("Replacement for %s has been changed to %s \n",input[cid-1401].fname, input[cid-1401].repart)

  Prompt to enter what the
scanf("%f",&input[numrec-1].recost) printf("Change  $%.2f \n",input[cid-1401].recost)   cost of the replacement part
  will be changed to

ush(stdin) printf("TO-")

system("cls") scanf("%f",input[cid-1401].recost)

i++ system("cls")

printf("Record Successfully Updated\n")

printf("Cost of replacement for %s has been changed to  $%.2f \n",input[cid-1401].fname, input[cid-1401].recost)

printf("That option does not exist")

RecEdit()

https://code2flow.com/app 1/1

Você também pode gostar