11 Replies - 1129 Views - Last Post: 16 August 2007 - 09:39 AM Rate Topic: -----

#1 suzette  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 11-August 07

this is my 1st project and i don't even know how to start

Post icon  Posted 14 August 2007 - 01:18 AM

this is my story: i'm a re-entering student.. i stopped for 3 years and started to work. i went back to studying comp. science but i was really surprised with all the codes, I don't remember any of them anymore!
so my instructor gave me a project in which i should make a program that adds, edits, deletes and searches for costumers..
my skill level is only in the if statements so i'm really in trouble.. i'm desperate for help.
any advice where should i start? thank you so much!

Is This A Good Question/Topic? 0
  • +

Replies To: this is my 1st project and i don't even know how to start

#2 vijaysnkar  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 55
  • Joined: 11-August 07

Re: this is my 1st project and i don't even know how to start

Posted 14 August 2007 - 02:28 AM

Really what you need? please specify the thing clearly !!

View Postsuzette, on 14 Aug, 2007 - 01:18 AM, said:

this is my story: i'm a re-entering student.. i stopped for 3 years and started to work. i went back to studying comp. science but i was really surprised with all the codes, I don't remember any of them anymore!
so my instructor gave me a project in which i should make a program that adds, edits, deletes and searches for costumers..
my skill level is only in the if statements so i'm really in trouble.. i'm desperate for help.
any advice where should i start? thank you so much!

Was This Post Helpful? 0
  • +
  • -

#3 suzette  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 11-August 07

Re: this is my 1st project and i don't even know how to start

Posted 14 August 2007 - 02:58 AM

the thing with my program is.. i know how to add names and other details but i'm stuck with that.. i dont know how to put an edit, search and delete command in my program..
i am new in programming and all i know are IF statements..
thanks for bearing with me..


View Postvijaysnkar, on 14 Aug, 2007 - 02:28 AM, said:

Really what you need? please specify the thing clearly !!

View Postsuzette, on 14 Aug, 2007 - 01:18 AM, said:

this is my story: i'm a re-entering student.. i stopped for 3 years and started to work. i went back to studying comp. science but i was really surprised with all the codes, I don't remember any of them anymore!
so my instructor gave me a project in which i should make a program that adds, edits, deletes and searches for costumers..
my skill level is only in the if statements so i'm really in trouble.. i'm desperate for help.
any advice where should i start? thank you so much!

Was This Post Helpful? 0
  • +
  • -

#4 Louisda16th  Icon User is offline

  • dream.in.assembly.code
  • member icon

Reputation: 15
  • View blog
  • Posts: 1,967
  • Joined: 03-August 06

Re: this is my 1st project and i don't even know how to start

Posted 14 August 2007 - 05:51 AM

Show your code. Are you using C or C++? I suggest you do some reading if you want to go ahead. You'll get some good Resources on this site: CLICK HERE
Was This Post Helpful? 0
  • +
  • -

#5 vijaysnkar  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 55
  • Joined: 11-August 07

Re: this is my 1st project and i don't even know how to start

Posted 14 August 2007 - 06:01 AM

Am also going to suggest the same.
Show us the code and in which platform are you working around?

View Postsuzette, on 14 Aug, 2007 - 02:58 AM, said:

the thing with my program is.. i know how to add names and other details but i'm stuck with that.. i dont know how to put an edit, search and delete command in my program..
i am new in programming and all i know are IF statements..
thanks for bearing with me..


View Postvijaysnkar, on 14 Aug, 2007 - 02:28 AM, said:

Really what you need? please specify the thing clearly !!

View Postsuzette, on 14 Aug, 2007 - 01:18 AM, said:

this is my story: i'm a re-entering student.. i stopped for 3 years and started to work. i went back to studying comp. science but i was really surprised with all the codes, I don't remember any of them anymore!
so my instructor gave me a project in which i should make a program that adds, edits, deletes and searches for costumers..
my skill level is only in the if statements so i'm really in trouble.. i'm desperate for help.
any advice where should i start? thank you so much!



Do some reading in the Tutorials present in this site and try to get a knowledge in C++.
This is what we can say you right now.

View Postvijaysnkar, on 14 Aug, 2007 - 05:59 AM, said:

Am also going to suggest the same.
Show us the code and in which platform are you working around?

View Postsuzette, on 14 Aug, 2007 - 02:58 AM, said:

the thing with my program is.. i know how to add names and other details but i'm stuck with that.. i dont know how to put an edit, search and delete command in my program..
i am new in programming and all i know are IF statements..
thanks for bearing with me..


View Postvijaysnkar, on 14 Aug, 2007 - 02:28 AM, said:

Really what you need? please specify the thing clearly !!

View Postsuzette, on 14 Aug, 2007 - 01:18 AM, said:

this is my story: i'm a re-entering student.. i stopped for 3 years and started to work. i went back to studying comp. science but i was really surprised with all the codes, I don't remember any of them anymore!
so my instructor gave me a project in which i should make a program that adds, edits, deletes and searches for costumers..
my skill level is only in the if statements so i'm really in trouble.. i'm desperate for help.
any advice where should i start? thank you so much!

Was This Post Helpful? 0
  • +
  • -

#6 suzette  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 11-August 07

Re: this is my 1st project and i don't even know how to start

Posted 14 August 2007 - 07:51 AM

this is what i made.. it's very long because all i don't know how to make other commands work so all i did is IF statements..

#include<stdio.h>
#include<conio.h>
#include<string.h>
#define p printf
#define s scanf

main()
{
char fname1, lname1, street1, city1, prov1,fname2, lname2, street2, city2, prov2,fname3, lname3, street3, city3, prov3,fname4, lname4, street4, city4, prov4,fname5, lname5, street5, city5, prov5, search;
int age5,age4,age3,age2,age1,choice;
clrscr();
begin:
p("Project 1");
p("\n1) Add Costumer");
p("\n2) Edit Costumer");
p("\n3) Search Costumer");
p("\n4) Delete Costumer");
p("\n5) Exit");
p("\n\nEnter Choice: ");
s("%i",&choice);
if (choice==1)
{one:
clrscr();
p("First Name: ");s("%s",&fname1);
p("\nLast Name: ");s("%s",&lname1);
p("\nAge: ");s("%i",&age1);
p("\nAddress: Street: ");s("%s",&street1);
p("\n City: ");s("%s",&city1);
p("\n Province: ");s("%s",&prov1);
p("Press any key to return to main menu...");
s(" ");
goto begin;
two:
clrscr();
p("First Name: ");s("%s",&fname2);
p("\nLast Name: ");s("%s",&lname2);
p("\nAge: ");s("%i",&age2);
p("\nAddress: Street: ");s("%s",&street2);
p("\n City: ");s("%s",&city2);
p("\n Province: ");s("%s",&prov2);
p("Press any key to return to main menu...");
s(" ");
goto begin;
three:
clrscr();
p("First Name: ");s("%s",&fname3);
p("\nLast Name: ");s("%s",&lname3);
p("\nAge: ");s("%i",&age3);
p("\nAddress: Street: ");s("%s",&street3);
p("\n City: ");s("%s",&city3);
p("\n Province: ");s("%s",&prov3);
p("Press any key to return to main menu...");
s(" ");
goto begin;
four:
clrscr();
p("First Name: ");s("%s",&fname4);
p("\nLast Name: ");s("%s",&lname4);
p("\nAge: ");s("%i",&age4);
p("\nAddress: Street: ");s("%s",&street4);
p("\n City: ");s("%s",&city4);
p("\n Province: ");s("%s",&prov4);
p("Press any key to return to main menu...");
s(" ");
goto begin;
five:
clrscr();
p("First Name: ");s("%s",&fname5);
p("\nLast Name: ");s("%s",&lname5);
p("\nAge: ");s("%i",&age5);
p("\nAddress: Street: ");s("%s",&street5);
p("\n City: ");s("%s",&city5);
p("\n Province: ");s("%s",&prov5);
p("Press any key to return to main menu...");
s(" ");
goto begin;}
if(choice==2)
{clrscr();
p("Edit which costumer: ");
p("\n1) %s %s",fname1,lname1);
p("\n2) %s %s",fname2,lname2);
p("\n3) %s %s",fname3,lname3);
p("\n4) %s %s",fname4,lname4);
p("\n5) %s %s",fname5,lname5);
s("%i",&choice);
edit:
if (choice==1)
goto one;
else if (choice==2)
goto two;
else if (choice==3)
goto three;
else if (choice==4)
goto four;
else if (choice==5)
goto five;
else
p("invalid input");
goto edit;
}
if (choice==3)
{clrscr();
p("enter last name: ");
s("%s",&search);
if (search==lname1)
{p("%s %s",fname1,lname1);p("\nAge: %i",age1);
p("\nAddress: %s, %s, %s",street1,city1,prov1);
p("\nPress any key to return to main menu...");
s(" ");
goto begin;
}
if (search==lname2)
{p("%s %s",fname1,lname2);p("\nAge: %i",age2);
p("\nAddress: %s, %s, %s",street2,city2,prov2);
p("\nPress any key to return to main menu...");
s(" ");
goto begin;
}
if (search==lname3)
{p("%s %s",fname3,lname3);p("\nAge: %i",age3);
p("\nAddress: %s, %s, %s",street3,city3,prov3);
p("\nPress any key to return to main menu...");
s(" ");
goto begin;
}
if (search==lname4)
{p("%s %s",fname4,lname4);p("\nAge: %i",age4);
p("\nAddress: %s, %s, %s",street4,city4,prov4);
p("\nPress any key to return to main menu...");
s(" ");
goto begin;
}
if (search==lname5)
{p("%s %s",fname5,lname5);p("\nAge: %i",age5);
p("\nAddress: %s, %s, %s",street5,city5,prov5);
p("Press any key to return to main menu...");
s(" ");
goto begin;
}
else
p("No entry");
p("\nPress any key to return to main menu...");
s(" ");
goto begin;
}
if (choice==4)
clrscr();
{p("Delete which profile: ");
p("\n1) %s %s",fname1,lname1);
p("\n2) %s %s",fname2,lname2);
p("\n3) %s %s",fname3,lname3);
p("\n4) %s %s",fname4,lname4);
p("\n5) %s %s",fname5,lname5);
s("%i",&choice);

if (choice==5)
{goto exit;}
if (choice<1&&choice>5)
{p("invalid input");}
goto begin;
exit:
getch();
return 0;
}


i'm using borland turbo c++ ver. 3
actually i'm kinda shy to show you this because i know there is a lot more better way to make this..
"if (choice==4)" is not finished because i dont know how to do that also.. and one last thing, how can i make the goto statement work? i tried to put delay(750) on it but it gives back an error..
Was This Post Helpful? 0
  • +
  • -

#7 Louisda16th  Icon User is offline

  • dream.in.assembly.code
  • member icon

Reputation: 15
  • View blog
  • Posts: 1,967
  • Joined: 03-August 06

Re: this is my 1st project and i don't even know how to start

Posted 14 August 2007 - 08:39 AM

A few suggestions before I actually help you out. It'll help you (as well as me) read your code more easily.
1. Don't #define your printf and scanf functios. Replace all the p's and s's with printfs and scanfs respectively.
2. Remove the clrscr()s. They're non standard.
3. Indent your code. That makes is more readable.
4. Rewrite the following set of printf statements as one:
p("Project 1");
p("\n1) Add Costumer");
p("\n2) Edit Costumer");
p("\n3) Search Costumer");
p("\n4) Delete Costumer");
p("\n5) Exit");
p("\n\nEnter Choice: ");


Write them as
printf("Project 1\n1) Add Costumer\n2) Edit Costumer\n3) Search Costumer\n4) Delete Costumer\n5) Exit\n\nEnter Choice: ");
	  scanf("%i",&choice);


Use code tags like I have.
Also, rather than me helping you, go to the link I gave above. You really need to do some learning if you want to get anywhere.
Was This Post Helpful? 0
  • +
  • -

#8 suzette  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 11-August 07

Re: this is my 1st project and i don't even know how to start

Posted 16 August 2007 - 02:38 AM

well i'm really stuck now.. still more to do..
Was This Post Helpful? 0
  • +
  • -

#9 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: this is my 1st project and i don't even know how to start

Posted 16 August 2007 - 05:54 AM

First and foremost, I would try to avoid using goto statements, but what error is it giving you? Can you post your updated code?
Was This Post Helpful? 0
  • +
  • -

#10 suzette  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 11-August 07

Re: this is my 1st project and i don't even know how to start

Posted 16 August 2007 - 06:20 AM

View PostAmadeus, on 16 Aug, 2007 - 05:54 AM, said:

First and foremost, I would try to avoid using goto statements, but what error is it giving you? Can you post your updated code?


it says unreachable code.. i would want to try other statements but that is all i know..
thanks!
Was This Post Helpful? 0
  • +
  • -

#11 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: this is my 1st project and i don't even know how to start

Posted 16 August 2007 - 07:59 AM

We'll need to see the exact error message as displayed by the compiler, and the exact code you are now using.

thanks,
Was This Post Helpful? 0
  • +
  • -

#12 Louisda16th  Icon User is offline

  • dream.in.assembly.code
  • member icon

Reputation: 15
  • View blog
  • Posts: 1,967
  • Joined: 03-August 06

Re: this is my 1st project and i don't even know how to start

Posted 16 August 2007 - 09:39 AM

Make you code more readable as I told you before. You can find errors more easily.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1